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

Unified Diff: components/omnibox/browser/search_suggestion_parser.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
Index: components/omnibox/browser/search_suggestion_parser.cc
diff --git a/components/omnibox/browser/search_suggestion_parser.cc b/components/omnibox/browser/search_suggestion_parser.cc
index a764d82135ecfd86848b82287dd3c89109adeb15..32f7e5fee69d8139a8105a3d57358a6a2dc2d667 100644
--- a/components/omnibox/browser/search_suggestion_parser.cc
+++ b/components/omnibox/browser/search_suggestion_parser.cc
@@ -9,6 +9,7 @@
#include <utility>
#include "base/i18n/icu_string_conversions.h"
+#include "base/json/json_reader.h"
#include "base/json/json_string_value_serializer.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
@@ -374,8 +375,8 @@ std::unique_ptr<base::Value> SearchSuggestionParser::DeserializeJsonData(
// Remove any XSSI guards to allow for JSON parsing.
json_data.remove_prefix(response_start_index);
- JSONStringValueDeserializer deserializer(json_data);
- deserializer.set_allow_trailing_comma(true);
+ JSONStringValueDeserializer deserializer(json_data,
+ base::JSON_ALLOW_TRAILING_COMMAS);
int error_code = 0;
std::unique_ptr<base::Value> data =
deserializer.Deserialize(&error_code, NULL);
« no previous file with comments | « components/bookmarks/browser/bookmark_storage.cc ('k') | components/policy/core/common/config_dir_policy_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698