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

Unified Diff: base/json/json_reader.cc

Issue 10003001: Update JSONReader to take base::StringPiece instead of std::string (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 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 c9f6e76ffb6904d07afa6d5445bc49bac92eb472..e96b62ddb287076998a572d1e010ba85c9edf60e 100644
--- a/base/json/json_reader.cc
+++ b/base/json/json_reader.cc
@@ -93,13 +93,13 @@ JSONReader::JSONReader()
error_col_(0) {}
// static
-Value* JSONReader::Read(const std::string& json,
+Value* JSONReader::Read(const StringPiece& json,
bool allow_trailing_comma) {
return ReadAndReturnError(json, allow_trailing_comma, NULL, NULL);
}
// static
-Value* JSONReader::ReadAndReturnError(const std::string& json,
+Value* JSONReader::ReadAndReturnError(const StringPiece& json,
bool allow_trailing_comma,
int* error_code_out,
std::string* error_msg_out) {
@@ -148,7 +148,7 @@ std::string JSONReader::GetErrorMessage() const {
ErrorCodeToString(error_code_));
}
-Value* JSONReader::JsonToValue(const std::string& json, bool check_root,
+Value* JSONReader::JsonToValue(const StringPiece& json, bool check_root,
bool allow_trailing_comma) {
// The input must be in UTF-8.
if (!IsStringUTF8(json.data())) {

Powered by Google App Engine
This is Rietveld 408576698