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

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: small cleanup 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
Index: ipc/ipc_channel_proxy.h
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index b0247c4d3c9a42fb8924c80e59059e6c258921a8..e0655033d11e68220d24cb34ae7c2644fa4005d7 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -14,6 +14,10 @@
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_listener.h"
+#include "ipc/ipc_message_filter.h"
+// TODO(dmichael): Remove this include of ipc_message_filter.h; move dependents
+// to including ipc_message_filter.h directly.
+// See crbug.com/364241
#include "ipc/ipc_sender.h"
namespace base {
@@ -22,6 +26,8 @@ class SingleThreadTaskRunner;
namespace IPC {
+class MessageFilter;
+class MessageFilterRouter;
class SendCallbackHelper;
//-----------------------------------------------------------------------------
@@ -54,53 +60,9 @@ 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>;
- };
+ // This typedef is for backwards compatibility, since the MessageFilter class
+ // used to be defined here. See crbug.com/364241
+ typedef IPC::MessageFilter MessageFilter;
jam 2014/04/22 17:14:27 i see only 56 files matching this, why not do it i
dmichael (off chromium) 2014/04/23 19:42:31 Just to make the review easier and make sure the m
// Initializes a channel proxy. The channel_handle and mode parameters are
// passed directly to the underlying IPC::Channel. The listener is called on
@@ -128,7 +90,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 +205,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') | ipc/ipc_message_filter.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698