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

Unified Diff: base/json/json_writer.h

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 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_value_serializer_unittest.cc ('k') | base/json/json_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_writer.h
diff --git a/base/json/json_writer.h b/base/json/json_writer.h
index 9709c7e723f05a25f3351607b73afc2c263e6f2e..5711665cbecb6970a4ea0c762819bd75f12b0848 100644
--- a/base/json/json_writer.h
+++ b/base/json/json_writer.h
@@ -38,11 +38,12 @@ class BASE_EXPORT JSONWriter {
// TODO(tc): Should we generate json if it would be invalid json (e.g.,
// |node| is not a DictionaryValue/ListValue or if there are inf/-inf float
// values)? Return true on success and false on failure.
- static bool Write(const Value* const node, std::string* json);
+ static bool Write(const Value& node, std::string* json);
// Same as above but with |options| which is a bunch of JSONWriter::Options
// bitwise ORed together. Return true on success and false on failure.
- static bool WriteWithOptions(const Value* const node, int options,
+ static bool WriteWithOptions(const Value& node,
+ int options,
std::string* json);
private:
@@ -50,7 +51,7 @@ class BASE_EXPORT JSONWriter {
// Called recursively to build the JSON string. When completed,
// |json_string_| will contain the JSON.
- bool BuildJSONString(const Value* const node, size_t depth);
+ bool BuildJSONString(const Value& node, size_t depth);
// Adds space to json_string_ for the indent level.
void IndentLine(size_t depth);
« no previous file with comments | « base/json/json_value_serializer_unittest.cc ('k') | base/json/json_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698