Index: content/public/browser/browser_message_filter.cc |
diff --git a/content/public/browser/browser_message_filter.cc b/content/public/browser/browser_message_filter.cc |
index e72a484d9687cb8019d529494bc659573c451ace..72b4a1cfc3d83e5a2f509f6ea311c9b47c049215 100644 |
--- a/content/public/browser/browser_message_filter.cc |
+++ b/content/public/browser/browser_message_filter.cc |
@@ -76,6 +76,14 @@ class BrowserMessageFilter::Internal : public IPC::ChannelProxy::MessageFilter { |
return true; |
} |
+ virtual bool GetSupportedMessageClasses( |
+ std::vector<uint32>* supported_message_classes) const OVERRIDE { |
+ supported_message_classes->assign( |
+ filter_->message_classes_to_filter().begin(), |
+ filter_->message_classes_to_filter().end()); |
+ return true; |
+ } |
+ |
// Dispatches a message to the derived class. |
bool DispatchMessage(const IPC::Message& message) { |
bool message_was_ok = true; |
@@ -96,12 +104,28 @@ class BrowserMessageFilter::Internal : public IPC::ChannelProxy::MessageFilter { |
DISALLOW_COPY_AND_ASSIGN(Internal); |
}; |
-BrowserMessageFilter::BrowserMessageFilter() |
- : internal_(NULL), channel_(NULL), |
+BrowserMessageFilter::BrowserMessageFilter(uint32 message_class_to_filter) |
+ : internal_(NULL), |
+ channel_(NULL), |
+#if defined(OS_WIN) |
+ peer_handle_(base::kNullProcessHandle), |
+#endif |
+ peer_pid_(base::kNullProcessId), |
+ message_classes_to_filter_(1, message_class_to_filter) {} |
+ |
+BrowserMessageFilter::BrowserMessageFilter( |
+ const uint32* message_classes_to_filter, |
+ size_t num_message_classes_to_filter) |
+ : internal_(NULL), |
+ channel_(NULL), |
#if defined(OS_WIN) |
peer_handle_(base::kNullProcessHandle), |
#endif |
- peer_pid_(base::kNullProcessId) { |
+ peer_pid_(base::kNullProcessId), |
+ message_classes_to_filter_( |
+ message_classes_to_filter, |
+ message_classes_to_filter + num_message_classes_to_filter) { |
+ DCHECK(num_message_classes_to_filter); |
} |
base::ProcessHandle BrowserMessageFilter::PeerHandle() { |