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

Side by Side Diff: mojo/public/cpp/bindings/connector.h

Issue 2358133002: Turn //mojo/public/cpp/bindings and //mojo/public/cpp/system into components (Closed)
Patch Set: Fix wording Created 4 years, 2 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
« no previous file with comments | « mojo/public/cpp/bindings/bindings_export.h ('k') | mojo/public/cpp/bindings/filter_chain.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 MOJO_PUBLIC_CPP_BINDINGS_CONNECTOR_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_CONNECTOR_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_CONNECTOR_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_CONNECTOR_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
13 #include "base/single_thread_task_runner.h" 14 #include "base/single_thread_task_runner.h"
14 #include "base/threading/thread_checker.h" 15 #include "base/threading/thread_checker.h"
16 #include "mojo/public/cpp/bindings/bindings_export.h"
15 #include "mojo/public/cpp/bindings/message.h" 17 #include "mojo/public/cpp/bindings/message.h"
16 #include "mojo/public/cpp/bindings/sync_handle_watcher.h" 18 #include "mojo/public/cpp/bindings/sync_handle_watcher.h"
17 #include "mojo/public/cpp/system/core.h" 19 #include "mojo/public/cpp/system/core.h"
18 #include "mojo/public/cpp/system/watcher.h" 20 #include "mojo/public/cpp/system/watcher.h"
19 21
20 namespace base { 22 namespace base {
21 class Lock; 23 class Lock;
22 } 24 }
23 25
24 namespace mojo { 26 namespace mojo {
25 27
26 // The Connector class is responsible for performing read/write operations on a 28 // The Connector class is responsible for performing read/write operations on a
27 // MessagePipe. It writes messages it receives through the MessageReceiver 29 // MessagePipe. It writes messages it receives through the MessageReceiver
28 // interface that it subclasses, and it forwards messages it reads through the 30 // interface that it subclasses, and it forwards messages it reads through the
29 // MessageReceiver interface assigned as its incoming receiver. 31 // MessageReceiver interface assigned as its incoming receiver.
30 // 32 //
31 // NOTE: 33 // NOTE:
32 // - MessagePipe I/O is non-blocking. 34 // - MessagePipe I/O is non-blocking.
33 // - Sending messages can be configured to be thread safe (please see comments 35 // - Sending messages can be configured to be thread safe (please see comments
34 // of the constructor). Other than that, the object should only be accessed 36 // of the constructor). Other than that, the object should only be accessed
35 // on the creating thread. 37 // on the creating thread.
36 class Connector : public MessageReceiver { 38 class MOJO_CPP_BINDINGS_EXPORT Connector
39 : NON_EXPORTED_BASE(public MessageReceiver) {
37 public: 40 public:
38 enum ConnectorConfig { 41 enum ConnectorConfig {
39 // Connector::Accept() is only called from a single thread. 42 // Connector::Accept() is only called from a single thread.
40 SINGLE_THREADED_SEND, 43 SINGLE_THREADED_SEND,
41 // Connector::Accept() is allowed to be called from multiple threads. 44 // Connector::Accept() is allowed to be called from multiple threads.
42 MULTI_THREADED_SEND 45 MULTI_THREADED_SEND
43 }; 46 };
44 47
45 // The Connector takes ownership of |message_pipe|. 48 // The Connector takes ownership of |message_pipe|.
46 Connector(ScopedMessagePipeHandle message_pipe, 49 Connector(ScopedMessagePipeHandle message_pipe,
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // transferred (i.e., when |connected_| is set to false). 212 // transferred (i.e., when |connected_| is set to false).
210 base::WeakPtr<Connector> weak_self_; 213 base::WeakPtr<Connector> weak_self_;
211 base::WeakPtrFactory<Connector> weak_factory_; 214 base::WeakPtrFactory<Connector> weak_factory_;
212 215
213 DISALLOW_COPY_AND_ASSIGN(Connector); 216 DISALLOW_COPY_AND_ASSIGN(Connector);
214 }; 217 };
215 218
216 } // namespace mojo 219 } // namespace mojo
217 220
218 #endif // MOJO_PUBLIC_CPP_BINDINGS_CONNECTOR_H_ 221 #endif // MOJO_PUBLIC_CPP_BINDINGS_CONNECTOR_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/bindings_export.h ('k') | mojo/public/cpp/bindings/filter_chain.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698