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); |