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

Side by Side Diff: ipc/message_filter.h

Issue 324143002: Decouple IPC::MessageFilter from IPC::Channel (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_sync_message_filter.cc ('k') | ipc/message_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef IPC_MESSAGE_FILTER_H_ 5 #ifndef IPC_MESSAGE_FILTER_H_
6 #define IPC_MESSAGE_FILTER_H_ 6 #define IPC_MESSAGE_FILTER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
11 #include "ipc/ipc_export.h" 11 #include "ipc/ipc_export.h"
12 12
13 namespace IPC { 13 namespace IPC {
14 14
15 class Channel; 15 class Sender;
16 class Message; 16 class Message;
17 17
18 // A class that receives messages on the thread where the IPC channel is 18 // A class that receives messages on the thread where the IPC channel is
19 // running. It can choose to prevent the default action for an IPC message. 19 // running. It can choose to prevent the default action for an IPC message.
20 class IPC_EXPORT MessageFilter 20 class IPC_EXPORT MessageFilter
21 : public base::RefCountedThreadSafe<MessageFilter> { 21 : public base::RefCountedThreadSafe<MessageFilter> {
22 public: 22 public:
23 MessageFilter(); 23 MessageFilter();
24 24
25 // Called on the background thread to provide the filter with access to the 25 // Called on the background thread to provide the filter with access to the
26 // channel. Called when the IPC channel is initialized or when AddFilter 26 // channel. Called when the IPC channel is initialized or when AddFilter
27 // is called if the channel is already initialized. 27 // is called if the channel is already initialized.
28 virtual void OnFilterAdded(Channel* channel); 28 virtual void OnFilterAdded(Sender* sender);
29 29
30 // Called on the background thread when the filter has been removed from 30 // Called on the background thread when the filter has been removed from
31 // the ChannelProxy and when the Channel is closing. After a filter is 31 // the ChannelProxy and when the Channel is closing. After a filter is
32 // removed, it will not be called again. 32 // removed, it will not be called again.
33 virtual void OnFilterRemoved(); 33 virtual void OnFilterRemoved();
34 34
35 // Called to inform the filter that the IPC channel is connected and we 35 // Called to inform the filter that the IPC channel is connected and we
36 // have received the internal Hello message from the peer. 36 // have received the internal Hello message from the peer.
37 virtual void OnChannelConnected(int32 peer_pid); 37 virtual void OnChannelConnected(int32 peer_pid);
38 38
(...skipping 19 matching lines...) Expand all
58 protected: 58 protected:
59 virtual ~MessageFilter(); 59 virtual ~MessageFilter();
60 60
61 private: 61 private:
62 friend class base::RefCountedThreadSafe<MessageFilter>; 62 friend class base::RefCountedThreadSafe<MessageFilter>;
63 }; 63 };
64 64
65 } // namespace IPC 65 } // namespace IPC
66 66
67 #endif // IPC_MESSAGE_FILTER_H_ 67 #endif // IPC_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « ipc/ipc_sync_message_filter.cc ('k') | ipc/message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698