Index: components/omnibox/search_suggestion_parser.cc |
diff --git a/components/omnibox/search_suggestion_parser.cc b/components/omnibox/search_suggestion_parser.cc |
index d8452ee9465435f6046366ce829e6e5fe1dd27fe..57e041ce459eb189667a11170770f556299d2c34 100644 |
--- a/components/omnibox/search_suggestion_parser.cc |
+++ b/components/omnibox/search_suggestion_parser.cc |
@@ -343,14 +343,14 @@ std::string SearchSuggestionParser::ExtractJsonData( |
// static |
scoped_ptr<base::Value> SearchSuggestionParser::DeserializeJsonData( |
- std::string json_data) { |
+ base::StringPiece json_data) { |
// The JSON response should be an array. |
for (size_t response_start_index = json_data.find("["), i = 0; |
- response_start_index != std::string::npos && i < 5; |
+ response_start_index != base::StringPiece::npos && i < 5; |
response_start_index = json_data.find("[", 1), i++) { |
// Remove any XSSI guards to allow for JSON parsing. |
if (response_start_index > 0) |
Peter Kasting
2015/02/05 09:20:36
Nit: This conditional could just be removed and th
Matt Giuca
2015/02/06 00:30:02
Done.
|
- json_data.erase(0, response_start_index); |
+ json_data.remove_prefix(response_start_index); |
JSONStringValueSerializer deserializer(json_data); |
deserializer.set_allow_trailing_comma(true); |