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

Unified Diff: content/browser/renderer_host/render_message_filter.cc

Issue 142923005: Allow MessageFilters to restrict listening to specific message classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 10 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: content/browser/renderer_host/render_message_filter.cc
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 17378bab77fb8fb2c03b915a721bffff9d897504..16a305dcfa3b7b8f22879a6bb3556091686f3651 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -101,6 +101,13 @@ const int kPluginsRefreshThresholdInSeconds = 3;
// usage only once and send it as a response for both queries.
static const int64 kCPUUsageSampleIntervalMs = 900;
+const uint32 kFilteredMessageClasses[] = {
+ ChildProcessMsgStart,
+ DesktopNotificationMsgStart,
+ FrameMsgStart,
+ ViewMsgStart,
+};
+
#if defined(OS_WIN)
// On Windows, |g_color_profile| can run on an arbitrary background thread.
// We avoid races by using LazyInstance's constructor lock to initialize the
@@ -320,7 +327,9 @@ RenderMessageFilter::RenderMessageFilter(
media::AudioManager* audio_manager,
MediaInternals* media_internals,
DOMStorageContextWrapper* dom_storage_context)
- : resource_dispatcher_host_(ResourceDispatcherHostImpl::Get()),
+ : BrowserMessageFilter(
+ kFilteredMessageClasses, arraysize(kFilteredMessageClasses)),
+ resource_dispatcher_host_(ResourceDispatcherHostImpl::Get()),
plugin_service_(plugin_service),
profile_data_directory_(browser_context->GetPath()),
request_context_(request_context),

Powered by Google App Engine
This is Rietveld 408576698