diff options
Diffstat (limited to 'chromium/base/json/json_reader.h')
-rw-r--r-- | chromium/base/json/json_reader.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chromium/base/json/json_reader.h b/chromium/base/json/json_reader.h index fb458cfe7c8..3eee07ccc3b 100644 --- a/chromium/base/json/json_reader.h +++ b/chromium/base/json/json_reader.h @@ -32,6 +32,7 @@ #include <string> #include "base/base_export.h" +#include "base/json/json_common.h" #include "base/optional.h" #include "base/strings/string_piece.h" #include "base/values.h" @@ -58,8 +59,6 @@ enum JSONParserOptions { class BASE_EXPORT JSONReader { public: - static const int kStackMaxDepth; - // Error codes during parsing. enum JsonParseError { JSON_NO_ERROR = 0, @@ -105,7 +104,8 @@ class BASE_EXPORT JSONReader { static const char kInputTooLarge[]; // Constructs a reader. - JSONReader(int options = JSON_PARSE_RFC, int max_depth = kStackMaxDepth); + JSONReader(int options = JSON_PARSE_RFC, + size_t max_depth = internal::kAbsoluteMaxDepth); ~JSONReader(); @@ -113,16 +113,17 @@ class BASE_EXPORT JSONReader { // If |json| is not a properly formed JSON string, returns base::nullopt. static Optional<Value> Read(StringPiece json, int options = JSON_PARSE_RFC, - int max_depth = kStackMaxDepth); + size_t max_depth = internal::kAbsoluteMaxDepth); // Deprecated. Use the Read() method above. // Reads and parses |json|, returning a Value. // If |json| is not a properly formed JSON string, returns nullptr. // Wrap this in base::FooValue::From() to check the Value is of type Foo and // convert to a FooValue at the same time. - static std::unique_ptr<Value> ReadDeprecated(StringPiece json, - int options = JSON_PARSE_RFC, - int max_depth = kStackMaxDepth); + static std::unique_ptr<Value> ReadDeprecated( + StringPiece json, + int options = JSON_PARSE_RFC, + size_t max_depth = internal::kAbsoluteMaxDepth); // Reads and parses |json| like Read(). Returns a ValueWithError, which on // error, will be populated with a formatted error message, an error code, and |