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

Unified Diff: base/json/json_value_serializer.h

Issue 8505033: Allow JSONWriter and JSONValueSerializer to omit binary values when instructed to do so. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Joi's comments. 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 | « no previous file | base/json/json_value_serializer.cc » ('j') | base/json/json_value_serializer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_value_serializer.h
diff --git a/base/json/json_value_serializer.h b/base/json/json_value_serializer.h
index 650008ec235aab6d356098b7c8c5bde0c1f7b224..cbac9fd83016b063dabd3674541be0b65b6532da 100644
--- a/base/json/json_value_serializer.h
+++ b/base/json/json_value_serializer.h
@@ -36,10 +36,15 @@ class BASE_EXPORT JSONStringValueSerializer : public base::ValueSerializer {
virtual ~JSONStringValueSerializer();
+ // Equivalent to calling Serialize(root, false).
+ virtual bool Serialize(const Value& root);
+
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
- // into the string passed into the constructor.
- virtual bool Serialize(const Value& root);
+ // into the string passed into the constructor. |ignore_binary_values| is
+ // used to indicate how the serializer should behave when encountering a
+ // binary value.
+ virtual bool Serialize(const Value& root, bool ignore_binary_values);
willchan no longer on Chromium 2011/11/10 18:33:07 No overloading, and why is this virtual, it's not
Eric Dingle 2011/11/10 23:19:57 Done.
// Attempt to deserialize the data structure encoded in the string passed
// in to the constructor into a structure of Value objects. If the return
@@ -78,6 +83,9 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
virtual ~JSONFileValueSerializer() {}
+ // Equivalent to calling Serialize(root, false).
+ virtual bool Serialize(const Value& root);
+
// DO NOT USE except in unit tests to verify the file was written properly.
// We should never serialize directly to a file since this will block the
// thread. Instead, serialize to a string and write to the file you want on
@@ -86,7 +94,7 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
// Attempt to serialize the data structure represented by Value into
// JSON. If the return value is true, the result will have been written
// into the file whose name was passed into the constructor.
- virtual bool Serialize(const Value& root);
+ virtual bool Serialize(const Value& root, bool ignore_binary_values);
// Attempt to deserialize the data structure encoded in the file passed
// in to the constructor into a structure of Value objects. If the return
« no previous file with comments | « no previous file | base/json/json_value_serializer.cc » ('j') | base/json/json_value_serializer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698