diff options
author | Luis Hector Chavez <lhchavez@google.com> | 2016-05-20 23:09:12 -0700 |
---|---|---|
committer | Luis Hector Chavez <lhchavez@google.com> | 2016-05-27 20:33:51 +0000 |
commit | 637be7990843742d7ac6910ea909dcb09e9df175 (patch) | |
tree | f6c3acf0a40a22d05c8f58a06edf689a06c5d791 /third_party/chromium/base/json/json_reader.cc | |
parent | d1f98a07056edc27b2b5b8b780f761796a1d8b1d (diff) | |
download | libweave-637be7990843742d7ac6910ea909dcb09e9df175.tar.gz |
libweave: Update libchrome APIs to r395517
The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.
BUG: 28985443
TEST: All tests in libweave_test pass on dragonboard-eng build
TEST: make testall
Change-Id: Iccc8acbd968bc104af44a9053570edf028323cf5
Reviewed-on: https://weave-review.googlesource.com/3611
Reviewed-by: Alex Vakulenko <avakulenko@google.com>
Diffstat (limited to 'third_party/chromium/base/json/json_reader.cc')
-rw-r--r-- | third_party/chromium/base/json/json_reader.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/third_party/chromium/base/json/json_reader.cc b/third_party/chromium/base/json/json_reader.cc index 3ab5f75..4ff7496 100644 --- a/third_party/chromium/base/json/json_reader.cc +++ b/third_party/chromium/base/json/json_reader.cc @@ -43,27 +43,28 @@ JSONReader::~JSONReader() { } // static -scoped_ptr<Value> JSONReader::Read(const StringPiece& json) { +std::unique_ptr<Value> JSONReader::Read(StringPiece json) { internal::JSONParser parser(JSON_PARSE_RFC); - return make_scoped_ptr(parser.Parse(json)); + return parser.Parse(json); } // static -scoped_ptr<Value> JSONReader::Read(const StringPiece& json, int options) { +std::unique_ptr<Value> JSONReader::Read(StringPiece json, int options) { internal::JSONParser parser(options); - return make_scoped_ptr(parser.Parse(json)); + return parser.Parse(json); } // static -scoped_ptr<Value> JSONReader::ReadAndReturnError(const StringPiece& json, - int options, - int* error_code_out, - std::string* error_msg_out, - int* error_line_out, - int* error_column_out) { +std::unique_ptr<Value> JSONReader::ReadAndReturnError( + const StringPiece& json, + int options, + int* error_code_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)); + std::unique_ptr<Value> root(parser.Parse(json)); if (!root) { if (error_code_out) *error_code_out = parser.error_code(); @@ -105,8 +106,8 @@ std::string JSONReader::ErrorCodeToString(JsonParseError error_code) { } } -scoped_ptr<Value> JSONReader::ReadToValue(const std::string& json) { - return make_scoped_ptr(parser_->Parse(json)); +std::unique_ptr<Value> JSONReader::ReadToValue(StringPiece json) { + return parser_->Parse(json); } JSONReader::JsonParseError JSONReader::error_code() const { |