Chromium Code Reviews| Index: base/json/json_reader.cc |
| diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc |
| index 983508cf4ff457f37b7061ef9e488d5f3f73dce7..4ff7496bbb15f7ca12c800e06e6aee21103814d5 100644 |
| --- a/base/json/json_reader.cc |
| +++ b/base/json/json_reader.cc |
| @@ -6,7 +6,6 @@ |
| #include "base/json/json_parser.h" |
| #include "base/logging.h" |
| -#include "base/memory/ptr_util.h" |
| #include "base/values.h" |
| namespace base { |
| @@ -44,15 +43,15 @@ JSONReader::~JSONReader() { |
| } |
| // static |
| -std::unique_ptr<Value> JSONReader::Read(const StringPiece& json) { |
| +std::unique_ptr<Value> JSONReader::Read(StringPiece json) { |
| internal::JSONParser parser(JSON_PARSE_RFC); |
| - return WrapUnique(parser.Parse(json)); |
| + return parser.Parse(json); |
|
danakj
2016/04/28 17:39:37
nit: move all the StringPieces?
dcheng
2016/04/28 18:03:23
See previous.
|
| } |
| // static |
| -std::unique_ptr<Value> JSONReader::Read(const StringPiece& json, int options) { |
| +std::unique_ptr<Value> JSONReader::Read(StringPiece json, int options) { |
| internal::JSONParser parser(options); |
| - return WrapUnique(parser.Parse(json)); |
| + return parser.Parse(json); |
| } |
| @@ -107,8 +106,8 @@ std::string JSONReader::ErrorCodeToString(JsonParseError error_code) { |
| } |
| } |
| -std::unique_ptr<Value> JSONReader::ReadToValue(const std::string& json) { |
| - return WrapUnique(parser_->Parse(json)); |
| +std::unique_ptr<Value> JSONReader::ReadToValue(StringPiece json) { |
| + return parser_->Parse(json); |
| } |
| JSONReader::JsonParseError JSONReader::error_code() const { |