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

Unified Diff: base/json/json_value_serializer.h

Issue 8423079: Allow trailing comma in JSON policy files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make the tests windows friendly too. 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/base.gyp ('k') | base/json/json_value_serializer.cc » ('j') | no next file with comments »
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 82fd9639c1a2c586a1961bfc7c140af07ea32b72..155adada2067b07b434c997d50f98defe9c4cbea 100644
--- a/base/json/json_value_serializer.h
+++ b/base/json/json_value_serializer.h
@@ -75,7 +75,8 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
// When deserializing, the file should exist, but when serializing, the
// serializer will attempt to create the file at the specified location.
explicit JSONFileValueSerializer(const FilePath& json_file_path)
- : json_file_path_(json_file_path) {}
+ : json_file_path_(json_file_path),
+ allow_trailing_comma_(false) {}
virtual ~JSONFileValueSerializer() {}
@@ -118,8 +119,13 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
// be a JsonFileError.
static const char* GetErrorMessageForCode(int error_code);
+ void set_allow_trailing_comma(bool new_value) {
+ allow_trailing_comma_ = new_value;
+ }
+
private:
FilePath json_file_path_;
+ bool allow_trailing_comma_;
// A wrapper for file_util::ReadFileToString which returns a non-zero
// JsonFileError if there were file errors.
« no previous file with comments | « base/base.gyp ('k') | base/json/json_value_serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698