Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / public / browser / browser_message_filter.h
index ad1f069..3330dfe 100644 (file)
@@ -19,6 +19,10 @@ namespace base {
 class TaskRunner;
 }
 
+namespace IPC {
+class MessageFilter;
+}
+
 namespace content {
 struct BrowserMessageFilterTraits;
 
@@ -29,10 +33,12 @@ class CONTENT_EXPORT BrowserMessageFilter
           BrowserMessageFilter, BrowserMessageFilterTraits>,
       public IPC::Sender {
  public:
-  BrowserMessageFilter();
+  explicit BrowserMessageFilter(uint32 message_class_to_filter);
+  BrowserMessageFilter(const uint32* message_classes_to_filter,
+                       size_t num_message_classes_to_filter);
 
-  // These match the corresponding IPC::ChannelProxy::MessageFilter methods and
-  // are always called on the IO thread.
+  // These match the corresponding IPC::MessageFilter methods and are always
+  // called on the IO thread.
   virtual void OnFilterAdded(IPC::Channel* channel) {}
   virtual void OnFilterRemoved() {}
   virtual void OnChannelClosing() {}
@@ -91,6 +97,10 @@ class CONTENT_EXPORT BrowserMessageFilter
   // Can be called on any thread.
   virtual void BadMessageReceived();
 
+  const std::vector<uint32>& message_classes_to_filter() const {
+    return message_classes_to_filter_;
+  }
+
  protected:
   virtual ~BrowserMessageFilter();
 
@@ -106,17 +116,19 @@ class CONTENT_EXPORT BrowserMessageFilter
   // This is private because the only classes that need access to it are made
   // friends above. This is only guaranteed to be valid on creation, after that
   // this class could outlive the filter.
-  IPC::ChannelProxy::MessageFilter* GetFilter();
+  IPC::MessageFilter* GetFilter();
 
-  // This implements IPC::ChannelProxy::MessageFilter so that we can hide that
-  // from child classes. Internal keeps a reference to this class, which is why
-  // there's a weak pointer back. This class could outlive Internal based on
-  // what the child class does in its OnDestruct method.
+  // This implements IPC::MessageFilter so that we can hide that from child
+  // classes. Internal keeps a reference to this class, which is why there's a
+  // weak pointer back. This class could outlive Internal based on what the
+  // child class does in its OnDestruct method.
   Internal* internal_;
 
   IPC::Channel* channel_;
   base::ProcessId peer_pid_;
 
+  std::vector<uint32> message_classes_to_filter_;
+
 #if defined(OS_WIN)
   base::Lock peer_handle_lock_;
   base::ProcessHandle peer_handle_;