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

Side by Side Diff: ipc/ipc_channel_proxy.h

Issue 11308278: Marked IPC::ChannelProxy as non thread-safe. Added DCHECKs to verify that all public IPC::ChannelPr… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Allow Send() to be called from any thread. Created 8 years 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 | « no previous file | ipc/ipc_channel_proxy.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_CHANNEL_PROXY_H_ 5 #ifndef IPC_IPC_CHANNEL_PROXY_H_
6 #define IPC_IPC_CHANNEL_PROXY_H_ 6 #define IPC_IPC_CHANNEL_PROXY_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 "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "base/threading/non_thread_safe.h"
13 #include "ipc/ipc_channel.h" 14 #include "ipc/ipc_channel.h"
14 #include "ipc/ipc_channel_handle.h" 15 #include "ipc/ipc_channel_handle.h"
15 #include "ipc/ipc_listener.h" 16 #include "ipc/ipc_listener.h"
16 #include "ipc/ipc_sender.h" 17 #include "ipc/ipc_sender.h"
17 18
18 namespace base { 19 namespace base {
19 class SingleThreadTaskRunner; 20 class SingleThreadTaskRunner;
20 } 21 }
21 22
22 namespace IPC { 23 namespace IPC {
(...skipping 21 matching lines...) Expand all
44 // An IPC::ChannelProxy can have a MessageFilter associated with it, which will 45 // An IPC::ChannelProxy can have a MessageFilter associated with it, which will
45 // be notified of incoming messages on the IPC::Channel's thread. This gives 46 // be notified of incoming messages on the IPC::Channel's thread. This gives
46 // the consumer of IPC::ChannelProxy the ability to respond to incoming 47 // the consumer of IPC::ChannelProxy the ability to respond to incoming
47 // messages on this background thread instead of on their own thread, which may 48 // messages on this background thread instead of on their own thread, which may
48 // be bogged down with other processing. The result can be greatly improved 49 // be bogged down with other processing. The result can be greatly improved
49 // latency for messages that can be handled on a background thread. 50 // latency for messages that can be handled on a background thread.
50 // 51 //
51 // The consumer of IPC::ChannelProxy is responsible for allocating the Thread 52 // The consumer of IPC::ChannelProxy is responsible for allocating the Thread
52 // instance where the IPC::Channel will be created and operated. 53 // instance where the IPC::Channel will be created and operated.
53 // 54 //
54 class IPC_EXPORT ChannelProxy : public Sender { 55 class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
55 public: 56 public:
56 struct MessageFilterTraits; 57 struct MessageFilterTraits;
57 58
58 // A class that receives messages on the thread where the IPC channel is 59 // A class that receives messages on the thread where the IPC channel is
59 // running. It can choose to prevent the default action for an IPC message. 60 // running. It can choose to prevent the default action for an IPC message.
60 class IPC_EXPORT MessageFilter 61 class IPC_EXPORT MessageFilter
61 : public base::RefCountedThreadSafe<MessageFilter, MessageFilterTraits> { 62 : public base::RefCountedThreadSafe<MessageFilter, MessageFilterTraits> {
62 public: 63 public:
63 MessageFilter(); 64 MessageFilter();
64 65
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 284
284 OutgoingMessageFilter* outgoing_message_filter_; 285 OutgoingMessageFilter* outgoing_message_filter_;
285 286
286 // Whether the channel has been initialized. 287 // Whether the channel has been initialized.
287 bool did_init_; 288 bool did_init_;
288 }; 289 };
289 290
290 } // namespace IPC 291 } // namespace IPC
291 292
292 #endif // IPC_IPC_CHANNEL_PROXY_H_ 293 #endif // IPC_IPC_CHANNEL_PROXY_H_
OLDNEW
« no previous file with comments | « no previous file | ipc/ipc_channel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698