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

Side by Side Diff: ipc/ipc_sync_message_filter.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ipc/ipc_forwarding_message_filter.cc ('k') | ipc/ipc_sync_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_IPC_SYNC_MESSAGE_FILTER_H_ 5 #ifndef IPC_IPC_SYNC_MESSAGE_FILTER_H_
6 #define IPC_IPC_SYNC_MESSAGE_FILTER_H_ 6 #define IPC_IPC_SYNC_MESSAGE_FILTER_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "ipc/ipc_channel_proxy.h" 13 #include "ipc/ipc_sender.h"
14 #include "ipc/ipc_sync_message.h" 14 #include "ipc/ipc_sync_message.h"
15 #include "ipc/message_filter.h"
15 16
16 namespace base { 17 namespace base {
17 class MessageLoopProxy; 18 class MessageLoopProxy;
18 class WaitableEvent; 19 class WaitableEvent;
19 } 20 }
20 21
21 namespace IPC { 22 namespace IPC {
22 23
23 // This MessageFilter allows sending synchronous IPC messages from a thread 24 // This MessageFilter allows sending synchronous IPC messages from a thread
24 // other than the listener thread associated with the SyncChannel. It does not 25 // other than the listener thread associated with the SyncChannel. It does not
25 // support fancy features that SyncChannel does, such as handling recursion or 26 // support fancy features that SyncChannel does, such as handling recursion or
26 // receiving messages while waiting for a response. Note that this object can 27 // receiving messages while waiting for a response. Note that this object can
27 // be used to send simultaneous synchronous messages from different threads. 28 // be used to send simultaneous synchronous messages from different threads.
28 class IPC_EXPORT SyncMessageFilter : public ChannelProxy::MessageFilter, 29 class IPC_EXPORT SyncMessageFilter : public MessageFilter, public Sender {
29 public Sender {
30 public: 30 public:
31 explicit SyncMessageFilter(base::WaitableEvent* shutdown_event); 31 explicit SyncMessageFilter(base::WaitableEvent* shutdown_event);
32 32
33 // MessageSender implementation. 33 // MessageSender implementation.
34 virtual bool Send(Message* message) OVERRIDE; 34 virtual bool Send(Message* message) OVERRIDE;
35 35
36 // ChannelProxy::MessageFilter implementation. 36 // MessageFilter implementation.
37 virtual void OnFilterAdded(Channel* channel) OVERRIDE; 37 virtual void OnFilterAdded(Channel* channel) OVERRIDE;
38 virtual void OnChannelError() OVERRIDE; 38 virtual void OnChannelError() OVERRIDE;
39 virtual void OnChannelClosing() OVERRIDE; 39 virtual void OnChannelClosing() OVERRIDE;
40 virtual bool OnMessageReceived(const Message& message) OVERRIDE; 40 virtual bool OnMessageReceived(const Message& message) OVERRIDE;
41 41
42 protected: 42 protected:
43 virtual ~SyncMessageFilter(); 43 virtual ~SyncMessageFilter();
44 44
45 private: 45 private:
46 void SendOnIOThread(Message* message); 46 void SendOnIOThread(Message* message);
(...skipping 16 matching lines...) Expand all
63 base::Lock lock_; 63 base::Lock lock_;
64 64
65 base::WaitableEvent* shutdown_event_; 65 base::WaitableEvent* shutdown_event_;
66 66
67 DISALLOW_COPY_AND_ASSIGN(SyncMessageFilter); 67 DISALLOW_COPY_AND_ASSIGN(SyncMessageFilter);
68 }; 68 };
69 69
70 } // namespace IPC 70 } // namespace IPC
71 71
72 #endif // IPC_IPC_SYNC_MESSAGE_FILTER_H_ 72 #endif // IPC_IPC_SYNC_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « ipc/ipc_forwarding_message_filter.cc ('k') | ipc/ipc_sync_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698