Pull the new r369476 of base library from Chromium
The merge was done against r369476 which corresponds to git commit
0471d0e2e2ef4a544a63481a389e1df33ea7c00a of Jan 14, 2016
Change-Id: Ie6894cf65424cc5ad115110faccd51602b2d1234
Reviewed-on: https://weave-review.googlesource.com/2225
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
diff --git a/third_party/chromium/base/json/json_reader.cc b/third_party/chromium/base/json/json_reader.cc
index edff8dc..3ab5f75 100644
--- a/third_party/chromium/base/json/json_reader.cc
+++ b/third_party/chromium/base/json/json_reader.cc
@@ -11,8 +11,8 @@
namespace base {
// Values 1000 and above are used by JSONFileValueSerializer::JsonFileError.
-COMPILE_ASSERT(JSONReader::JSON_PARSE_ERROR_COUNT < 1000,
- json_reader_error_out_of_bounds);
+static_assert(JSONReader::JSON_PARSE_ERROR_COUNT < 1000,
+ "JSONReader error out of bounds");
const char JSONReader::kInvalidEscape[] =
"Invalid escape sequence.";
@@ -43,41 +43,25 @@
}
// static
-Value* JSONReader::DeprecatedRead(const std::string& json) {
- return Read(json).release();
-}
-
-// static
-scoped_ptr<Value> JSONReader::Read(const std::string& json) {
+scoped_ptr<Value> JSONReader::Read(const StringPiece& json) {
internal::JSONParser parser(JSON_PARSE_RFC);
return make_scoped_ptr(parser.Parse(json));
}
// static
-Value* JSONReader::DeprecatedRead(const std::string& json, int options) {
- return Read(json, options).release();
-}
-
-// static
-scoped_ptr<Value> JSONReader::Read(const std::string& json, int options) {
+scoped_ptr<Value> JSONReader::Read(const StringPiece& json, int options) {
internal::JSONParser parser(options);
return make_scoped_ptr(parser.Parse(json));
}
-// static
-Value* JSONReader::DeprecatedReadAndReturnError(const std::string& json,
- int options,
- int* error_code_out,
- std::string* error_msg_out) {
- return ReadAndReturnError(json, options, error_code_out, error_msg_out)
- .release();
-}
// static
-scoped_ptr<Value> JSONReader::ReadAndReturnError(const std::string& json,
+scoped_ptr<Value> JSONReader::ReadAndReturnError(const StringPiece& json,
int options,
int* error_code_out,
- std::string* error_msg_out) {
+ std::string* error_msg_out,
+ int* error_line_out,
+ int* error_column_out) {
internal::JSONParser parser(options);
scoped_ptr<Value> root(parser.Parse(json));
if (!root) {
@@ -85,6 +69,10 @@
*error_code_out = parser.error_code();
if (error_msg_out)
*error_msg_out = parser.GetErrorMessage();
+ if (error_line_out)
+ *error_line_out = parser.error_line();
+ if (error_column_out)
+ *error_column_out = parser.error_column();
}
return root;