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

Unified Diff: base/json/json_reader.h

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: Sync with Parser changes Created 8 years, 7 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
« no previous file with comments | « base/json/json_parser.cc ('k') | base/json/json_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_reader.h
diff --git a/base/json/json_reader.h b/base/json/json_reader.h
index e0811754b1957f36a4cd01b462aa835810671f25..a11102f0036e28baa8c32cd50368655826f0165c 100644
--- a/base/json/json_reader.h
+++ b/base/json/json_reader.h
@@ -33,6 +33,7 @@
#include "base/base_export.h"
#include "base/basictypes.h"
+#include "base/string_piece.h"
#include "base/memory/scoped_ptr.h"
namespace base {
@@ -95,18 +96,18 @@ class BASE_EXPORT JSONReader {
// Reads and parses |json|, returning a Value. The caller owns the returned
// instance. If |json| is not a properly formed JSON string, returns NULL.
- static Value* Read(const std::string& json);
+ static Value* Read(const StringPiece& json);
// Reads and parses |json|, returning a Value owned by the caller. The
// parser respects the given |options|. If the input is not properly formed,
// returns NULL.
- static Value* Read(const std::string& json, int options);
+ static Value* Read(const StringPiece& json, int options);
// Reads and parses |json| like Read(). |error_code_out| and |error_msg_out|
// are optional. If specified and NULL is returned, they will be populated
// an error code and a formatted error message (including error location if
// appropriate). Otherwise, they will be unmodified.
- static Value* ReadAndReturnError(const std::string& json,
+ static Value* ReadAndReturnError(const StringPiece& json,
int options, // JSONParserOptions
int* error_code_out,
std::string* error_msg_out);
« no previous file with comments | « base/json/json_parser.cc ('k') | base/json/json_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698