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

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2643183002: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. (Closed)
Patch Set: Convert ChromeViewHostMsg_UpdatedCacheStats to use mojo. Created 3 years, 9 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/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index 6a5b77a8e5dec353bed7435c62b870c190352bf9..3ca7a93571a7b96fe4aeea22fca29609643919ad 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -39,6 +39,7 @@
#include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
#include "chrome/browser/budget_service/budget_service_impl.h"
+#include "chrome/browser/cache_stats_recorder.h"
#include "chrome/browser/chrome_content_browser_client_parts.h"
#include "chrome/browser/chrome_quota_permission_context.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
@@ -3070,7 +3071,16 @@ bool ChromeContentBrowserClient::PreSpawnRenderer(
void ChromeContentBrowserClient::ExposeInterfacesToRenderer(
service_manager::InterfaceRegistry* registry,
+ content::AssociatedInterfaceRegistry* associated_registry,
content::RenderProcessHost* render_process_host) {
+ // The CacheStatsRecorder is an associated binding, instead of a
+ // non-associated one, because the sender (in the renderer process) posts the
+ // message after a time delay, in order to rate limit. The association
+ // protects against the render process host ID being recycled in that time
+ // gap between the preparation and the execution of that IPC.
+ associated_registry->AddInterface(
+ base::Bind(&CacheStatsRecorder::Create, render_process_host->GetID()));
+
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner =
content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::UI);

Powered by Google App Engine
This is Rietveld 408576698