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

Unified Diff: ipc/ipc_channel_proxy.h

Issue 245443005: Move IPC::MessageFilter and router to a separate file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gn build Created 6 years, 8 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
« no previous file with comments | « ipc/ipc.gypi ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.h
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index b0247c4d3c9a42fb8924c80e59059e6c258921a8..375a42b34200e8e0e998f203b1db7b38a35cf81d 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -22,6 +22,8 @@ class SingleThreadTaskRunner;
namespace IPC {
+class MessageFilter;
+class MessageFilterRouter;
class SendCallbackHelper;
//-----------------------------------------------------------------------------
@@ -54,54 +56,6 @@ class SendCallbackHelper;
//
class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
public:
-
- // A class that receives messages on the thread where the IPC channel is
- // running. It can choose to prevent the default action for an IPC message.
- class IPC_EXPORT MessageFilter
- : public base::RefCountedThreadSafe<MessageFilter> {
- public:
- MessageFilter();
-
- // Called on the background thread to provide the filter with access to the
- // channel. Called when the IPC channel is initialized or when AddFilter
- // is called if the channel is already initialized.
- virtual void OnFilterAdded(Channel* channel);
-
- // Called on the background thread when the filter has been removed from
- // the ChannelProxy and when the Channel is closing. After a filter is
- // removed, it will not be called again.
- virtual void OnFilterRemoved();
-
- // Called to inform the filter that the IPC channel is connected and we
- // have received the internal Hello message from the peer.
- virtual void OnChannelConnected(int32 peer_pid);
-
- // Called when there is an error on the channel, typically that the channel
- // has been closed.
- virtual void OnChannelError();
-
- // Called to inform the filter that the IPC channel will be destroyed.
- // OnFilterRemoved is called immediately after this.
- virtual void OnChannelClosing();
-
- // Return true to indicate that the message was handled, or false to let
- // the message be handled in the default way.
- virtual bool OnMessageReceived(const Message& message);
-
- // Called to query the Message classes supported by the filter. Return
- // false to indicate that all message types should reach the filter, or true
- // if the resulting contents of |supported_message_classes| may be used to
- // selectively offer messages of a particular class to the filter.
- virtual bool GetSupportedMessageClasses(
- std::vector<uint32>* supported_message_classes) const;
-
- protected:
- virtual ~MessageFilter();
-
- private:
- friend class base::RefCountedThreadSafe<MessageFilter>;
- };
-
// Initializes a channel proxy. The channel_handle and mode parameters are
// passed directly to the underlying IPC::Channel. The listener is called on
// the thread that creates the ChannelProxy. The filter's OnMessageReceived
@@ -128,7 +82,7 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
// background thread processes the command to close the channel. It is ok to
// call this method multiple times. Redundant calls are ignored.
//
- // WARNING: The MessageFilter object held by the ChannelProxy is also
+ // WARNING: MessageFilter objects held by the ChannelProxy is also
// released asynchronously, and it may in fact have its final reference
// released on the background thread. The caller should be careful to deal
// with / allow for this possibility.
@@ -243,7 +197,6 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
// Routes a given message to a proper subset of |filters_|, depending
// on which message classes a filter might support.
- class MessageFilterRouter;
scoped_ptr<MessageFilterRouter> message_filter_router_;
// Holds filters between the AddFilter call on the listerner thread and the
« no previous file with comments | « ipc/ipc.gypi ('k') | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698