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

Unified Diff: base/json/json_string_value_serializer.cc

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 | « base/json/json_string_value_serializer.h ('k') | base/json/json_value_serializer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/json/json_string_value_serializer.cc
diff --git a/base/json/json_string_value_serializer.cc b/base/json/json_string_value_serializer.cc
index cd786db9e77455b116cc9dde07987b7b4050310d..2e46ab387a20a19b9fe02735640e97907c13896f 100644
--- a/base/json/json_string_value_serializer.cc
+++ b/base/json/json_string_value_serializer.cc
@@ -41,18 +41,15 @@ bool JSONStringValueSerializer::SerializeInternal(const Value& root,
}
JSONStringValueDeserializer::JSONStringValueDeserializer(
- const base::StringPiece& json_string)
- : json_string_(json_string),
- allow_trailing_comma_(false) {
-}
+ const base::StringPiece& json_string,
+ int options)
+ : json_string_(json_string), options_(options) {}
JSONStringValueDeserializer::~JSONStringValueDeserializer() {}
std::unique_ptr<Value> JSONStringValueDeserializer::Deserialize(
int* error_code,
std::string* error_str) {
- return base::JSONReader::ReadAndReturnError(
- json_string_, allow_trailing_comma_ ? base::JSON_ALLOW_TRAILING_COMMAS
- : base::JSON_PARSE_RFC,
- error_code, error_str);
+ return base::JSONReader::ReadAndReturnError(json_string_, options_,
+ error_code, error_str);
}
« no previous file with comments | « base/json/json_string_value_serializer.h ('k') | base/json/json_value_serializer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698