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

Unified Diff: content/browser/shared_worker/shared_worker_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/shared_worker/shared_worker_message_filter.cc
diff --git a/content/browser/shared_worker/shared_worker_message_filter.cc b/content/browser/shared_worker/shared_worker_message_filter.cc
index 1269ac3ddcb949ba6b62e7ac040d077d9c0b4ec1..ca6abe76fe97dc4a86b5b55e4937f95adffdae49 100644
--- a/content/browser/shared_worker/shared_worker_message_filter.cc
+++ b/content/browser/shared_worker/shared_worker_message_filter.cc
@@ -12,13 +12,21 @@
#include "content/common/worker_messages.h"
namespace content {
+namespace {
+const uint32 kFilteredMessageClasses[] = {
+ ViewMsgStart,
+ WorkerMsgStart,
+};
+} // namespace
SharedWorkerMessageFilter::SharedWorkerMessageFilter(
int render_process_id,
ResourceContext* resource_context,
const WorkerStoragePartition& partition,
MessagePortMessageFilter* message_port_message_filter)
- : render_process_id_(render_process_id),
+ : BrowserMessageFilter(
+ kFilteredMessageClasses, arraysize(kFilteredMessageClasses)),
+ render_process_id_(render_process_id),
resource_context_(resource_context),
partition_(partition),
message_port_message_filter_(message_port_message_filter) {

Powered by Google App Engine
This is Rietveld 408576698