Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2339)

Unified Diff: base/json/json_reader.cc

Issue 1927753002: Convert callers of base::DeepCopy() to base::CreateDeepCopy() in //base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698