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

Unified Diff: chrome/browser/renderer_host/chrome_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: chrome/browser/renderer_host/chrome_render_message_filter.cc
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index e29587d3275d83c37dd8c975e6df56f11db881a6..b6a8cb0c06a82d08d56c8a73b46dbab6322e6d18 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -43,6 +43,11 @@ using blink::WebCache;
namespace {
+const uint32 kFilteredMessageClasses[] = {
+ ChromeMsgStart,
+ ExtensionMsgStart,
+};
+
// Logs an action to the extension activity log for the specified profile. Can
// be called from any thread.
void AddActionToExtensionActivityLog(
@@ -76,7 +81,9 @@ ChromeRenderMessageFilter::ChromeRenderMessageFilter(
int render_process_id,
Profile* profile,
net::URLRequestContextGetter* request_context)
- : render_process_id_(render_process_id),
+ : BrowserMessageFilter(
+ kFilteredMessageClasses, arraysize(kFilteredMessageClasses)),
+ render_process_id_(render_process_id),
profile_(profile),
off_the_record_(profile_->IsOffTheRecord()),
predictor_(profile_->GetNetworkPredictor()),

Powered by Google App Engine
This is Rietveld 408576698