diff options
Diffstat (limited to 'chromium/base/json/json_reader.cc')
-rw-r--r-- | chromium/base/json/json_reader.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/chromium/base/json/json_reader.cc b/chromium/base/json/json_reader.cc index d21eac9d180..43f66416624 100644 --- a/chromium/base/json/json_reader.cc +++ b/chromium/base/json/json_reader.cc @@ -13,10 +13,6 @@ namespace base { -// Chosen to support 99.9% of documents found in the wild late 2016. -// http://crbug.com/673263 -const int JSONReader::kStackMaxDepth = 200; - // Values 1000 and above are used by JSONFileValueSerializer::JsonFileError. static_assert(JSONReader::JSON_PARSE_ERROR_COUNT < 1000, "JSONReader error out of bounds"); @@ -49,20 +45,22 @@ JSONReader::ValueWithError::~ValueWithError() = default; JSONReader::ValueWithError& JSONReader::ValueWithError::operator=( ValueWithError&& other) = default; -JSONReader::JSONReader(int options, int max_depth) +JSONReader::JSONReader(int options, size_t max_depth) : parser_(new internal::JSONParser(options, max_depth)) {} JSONReader::~JSONReader() = default; // static -Optional<Value> JSONReader::Read(StringPiece json, int options, int max_depth) { +Optional<Value> JSONReader::Read(StringPiece json, + int options, + size_t max_depth) { internal::JSONParser parser(options, max_depth); return parser.Parse(json); } std::unique_ptr<Value> JSONReader::ReadDeprecated(StringPiece json, int options, - int max_depth) { + size_t max_depth) { Optional<Value> value = Read(json, options, max_depth); return value ? Value::ToUniquePtrValue(std::move(*value)) : nullptr; } |