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

Unified Diff: base/json/json_reader.h

Issue 2475583002: Adds option for JSON reader to allow invalid utf characters (Closed)
Patch Set: replace 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
Index: base/json/json_reader.h
diff --git a/base/json/json_reader.h b/base/json/json_reader.h
index a954821a288d690648457ae4c250a2a45ba0a4b1..00615feab900042885e45b8663a0652e7fb022a8 100644
--- a/base/json/json_reader.h
+++ b/base/json/json_reader.h
@@ -55,6 +55,11 @@ enum JSONParserOptions {
// if the child is Remove()d from root, it would result in use-after-free
// unless it is DeepCopy()ed or this option is used.
JSON_DETACHABLE_CHILDREN = 1 << 1,
+
+ // If set the parser replaces invalid characters with
+ // kUnicodeReplacementString. If not set, invalid characters trigger a hard
+ // error and parsing fails.
+ JSON_REPLACE_INVALID_CHARACTERS = 1 << 2,
};
class BASE_EXPORT JSONReader {

Powered by Google App Engine
This is Rietveld 408576698