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

Unified Diff: base/json/json_value_serializer.cc

Issue 8528051: Revert 110021 - Broke CrOS compile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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.h ('k') | base/json/json_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_value_serializer.cc
===================================================================
--- base/json/json_value_serializer.cc (revision 110026)
+++ base/json/json_value_serializer.cc (working copy)
@@ -17,24 +17,10 @@
JSONStringValueSerializer::~JSONStringValueSerializer() {}
bool JSONStringValueSerializer::Serialize(const Value& root) {
- return SerializeInternal(root, false);
-}
-
-bool JSONStringValueSerializer::SerializeAndOmitBinaryValues(
- const Value& root) {
- return SerializeInternal(root, true);
-}
-
-bool JSONStringValueSerializer::SerializeInternal(const Value& root,
- bool omit_binary_values) {
if (!json_string_ || initialized_with_const_string_)
return false;
- base::JSONWriter::WriteWithOptions(
- &root,
- pretty_print_,
- omit_binary_values ? base::JSONWriter::OPTIONS_OMIT_BINARY_VALUES : 0,
- json_string_);
+ base::JSONWriter::Write(&root, pretty_print_, json_string_);
return true;
}
@@ -52,21 +38,10 @@
/******* File Serializer *******/
bool JSONFileValueSerializer::Serialize(const Value& root) {
- return SerializeInternal(root, false);
-}
-
-bool JSONFileValueSerializer::SerializeAndOmitBinaryValues(const Value& root) {
- return SerializeInternal(root, true);
-}
-
-bool JSONFileValueSerializer::SerializeInternal(const Value& root,
- bool omit_binary_values) {
std::string json_string;
JSONStringValueSerializer serializer(&json_string);
serializer.set_pretty_print(true);
- bool result = omit_binary_values ?
- serializer.SerializeAndOmitBinaryValues(root) :
- serializer.Serialize(root);
+ bool result = serializer.Serialize(root);
if (!result)
return false;
« no previous file with comments | « base/json/json_value_serializer.h ('k') | base/json/json_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698