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

Unified Diff: chrome/browser/ui/app_list/search/common/json_response_fetcher.cc

Issue 1214903010: Make JSONParser a pure interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: review Created 5 years, 6 months 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: chrome/browser/ui/app_list/search/common/json_response_fetcher.cc
diff --git a/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc b/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc
index f175e44b01981587938d95f525a267d1b5bc0201..5eb72b96ef8fb5ed0a02b91cb9d81be1b39c3ae7 100644
--- a/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc
+++ b/chrome/browser/ui/app_list/search/common/json_response_fetcher.cc
@@ -72,14 +72,12 @@ void JSONResponseFetcher::OnURLFetchComplete(
std::string json_data;
fetcher->GetResponseAsString(&json_data);
- scoped_refptr<safe_json::SafeJsonParser> parser =
- new safe_json::SafeJsonParser(
- json_data, base::Bind(&JSONResponseFetcher::OnJsonParseSuccess,
- weak_factory_.GetWeakPtr()),
- base::Bind(&JSONResponseFetcher::OnJsonParseError,
- weak_factory_.GetWeakPtr()));
// The parser will call us back via one of the callbacks.
- parser->Start();
+ safe_json::SafeJsonParser::Parse(
+ json_data, base::Bind(&JSONResponseFetcher::OnJsonParseSuccess,
+ weak_factory_.GetWeakPtr()),
+ base::Bind(&JSONResponseFetcher::OnJsonParseError,
+ weak_factory_.GetWeakPtr()));
}
} // namespace app_list

Powered by Google App Engine
This is Rietveld 408576698