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

Unified Diff: chrome/browser/ui/webui/popular_sites_internals_message_handler.cc

Issue 2192783002: Parse PopularSites JSON by callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@json
Patch Set: Created 4 years, 5 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
« no previous file with comments | « chrome/browser/android/ntp/most_visited_sites_bridge.cc ('k') | components/ntp_tiles.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/popular_sites_internals_message_handler.cc
diff --git a/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc b/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc
index 55db0a3dd7bc6b2bf56cc9dd8c3a98418498b2f2..8bdc53dac364aefbdd267371413f7c0ea9b7870a 100644
--- a/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "components/ntp_tiles/pref_names.h"
#include "components/prefs/pref_service.h"
+#include "components/safe_json/safe_json_parser.h"
#include "components/url_formatter/url_fixer.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_ui.h"
@@ -66,7 +67,8 @@ void PopularSitesInternalsMessageHandler::HandleRegisterForEvents(
content::BrowserThread::GetBlockingPool(), profile->GetPrefs(),
TemplateURLServiceFactory::GetForProfile(profile),
g_browser_process->variations_service(), profile->GetRequestContext(),
- ChromePopularSites::GetDirectory()));
+ ChromePopularSites::GetDirectory(),
+ base::Bind(safe_json::SafeJsonParser::Parse)));
popular_sites_->StartFetch(
false,
base::Bind(&PopularSitesInternalsMessageHandler::OnPopularSitesAvailable,
@@ -109,7 +111,8 @@ void PopularSitesInternalsMessageHandler::HandleUpdate(
content::BrowserThread::GetBlockingPool(), prefs,
TemplateURLServiceFactory::GetForProfile(profile),
g_browser_process->variations_service(), profile->GetRequestContext(),
- ChromePopularSites::GetDirectory()));
+ ChromePopularSites::GetDirectory(),
+ base::Bind(safe_json::SafeJsonParser::Parse)));
popular_sites_->StartFetch(true, callback);
}
« no previous file with comments | « chrome/browser/android/ntp/most_visited_sites_bridge.cc ('k') | components/ntp_tiles.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698