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

Unified Diff: base/json/json_file_value_serializer.h

Issue 2475583002: Adds option for JSON reader to allow invalid utf characters (Closed)
Patch Set: comment Created 4 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_file_value_serializer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_file_value_serializer.h
diff --git a/base/json/json_file_value_serializer.h b/base/json/json_file_value_serializer.h
index 67d2342b4cc16074a5e548afa02e7ddaebafcfbc..a93950a6080014e5d13666103fbdedf41546c94c 100644
--- a/base/json/json_file_value_serializer.h
+++ b/base/json/json_file_value_serializer.h
@@ -48,8 +48,9 @@ class BASE_EXPORT JSONFileValueSerializer : public base::ValueSerializer {
class BASE_EXPORT JSONFileValueDeserializer : public base::ValueDeserializer {
public:
// |json_file_path_| is the path of a file that will be source of the
- // deserialization.
- explicit JSONFileValueDeserializer(const base::FilePath& json_file_path);
+ // deserialization. |options| is a bitmask of JSONParserOptions.
+ explicit JSONFileValueDeserializer(const base::FilePath& json_file_path,
+ int options = 0);
~JSONFileValueDeserializer() override;
@@ -82,10 +83,6 @@ class BASE_EXPORT JSONFileValueDeserializer : public base::ValueDeserializer {
// be a JsonFileError.
static const char* GetErrorMessageForCode(int error_code);
- void set_allow_trailing_comma(bool new_value) {
- allow_trailing_comma_ = new_value;
- }
-
// Returns the size (in bytes) of JSON string read from disk in the last
// successful |Deserialize()| call.
size_t get_last_read_size() const { return last_read_size_; }
@@ -96,7 +93,7 @@ class BASE_EXPORT JSONFileValueDeserializer : public base::ValueDeserializer {
int ReadFileToString(std::string* json_string);
const base::FilePath json_file_path_;
- bool allow_trailing_comma_;
+ const int options_;
size_t last_read_size_;
DISALLOW_IMPLICIT_CONSTRUCTORS(JSONFileValueDeserializer);
« no previous file with comments | « no previous file | base/json/json_file_value_serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698