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

Side by Side Diff: mojo/public/cpp/bindings/lib/multiplex_router.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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_LIB_MULTIPLEX_ROUTER_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <string> 13 #include <string>
14 14
15 #include "base/compiler_specific.h"
15 #include "base/logging.h" 16 #include "base/logging.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/memory/ref_counted.h" 18 #include "base/memory/ref_counted.h"
18 #include "base/memory/weak_ptr.h" 19 #include "base/memory/weak_ptr.h"
19 #include "base/single_thread_task_runner.h" 20 #include "base/single_thread_task_runner.h"
20 #include "base/synchronization/lock.h" 21 #include "base/synchronization/lock.h"
21 #include "base/threading/thread_checker.h" 22 #include "base/threading/thread_checker.h"
22 #include "mojo/public/cpp/bindings/associated_group_controller.h" 23 #include "mojo/public/cpp/bindings/associated_group_controller.h"
24 #include "mojo/public/cpp/bindings/bindings_export.h"
23 #include "mojo/public/cpp/bindings/connector.h" 25 #include "mojo/public/cpp/bindings/connector.h"
24 #include "mojo/public/cpp/bindings/filter_chain.h" 26 #include "mojo/public/cpp/bindings/filter_chain.h"
25 #include "mojo/public/cpp/bindings/interface_id.h" 27 #include "mojo/public/cpp/bindings/interface_id.h"
26 #include "mojo/public/cpp/bindings/message_header_validator.h" 28 #include "mojo/public/cpp/bindings/message_header_validator.h"
27 #include "mojo/public/cpp/bindings/pipe_control_message_handler.h" 29 #include "mojo/public/cpp/bindings/pipe_control_message_handler.h"
28 #include "mojo/public/cpp/bindings/pipe_control_message_handler_delegate.h" 30 #include "mojo/public/cpp/bindings/pipe_control_message_handler_delegate.h"
29 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h" 31 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h"
30 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" 32 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
31 33
32 namespace base { 34 namespace base {
(...skipping 11 matching lines...) Expand all
44 // 46 //
45 // It is created on the thread where the master interface of the message pipe 47 // It is created on the thread where the master interface of the message pipe
46 // lives. Although it is ref-counted, it is guarateed to be destructed on the 48 // lives. Although it is ref-counted, it is guarateed to be destructed on the
47 // same thread. 49 // same thread.
48 // Some public methods are only allowed to be called on the creating thread; 50 // Some public methods are only allowed to be called on the creating thread;
49 // while the others are safe to call from any threads. Please see the method 51 // while the others are safe to call from any threads. Please see the method
50 // comments for more details. 52 // comments for more details.
51 // 53 //
52 // NOTE: CloseMessagePipe() or PassMessagePipe() MUST be called on |runner|'s 54 // NOTE: CloseMessagePipe() or PassMessagePipe() MUST be called on |runner|'s
53 // thread before this object is destroyed. 55 // thread before this object is destroyed.
54 class MultiplexRouter 56 class MOJO_CPP_BINDINGS_EXPORT MultiplexRouter
55 : public MessageReceiver, 57 : NON_EXPORTED_BASE(public MessageReceiver),
56 public AssociatedGroupController, 58 public AssociatedGroupController,
57 public PipeControlMessageHandlerDelegate { 59 NON_EXPORTED_BASE(public PipeControlMessageHandlerDelegate) {
58 public: 60 public:
59 enum Config { 61 enum Config {
60 // There is only the master interface running on this router. Please note 62 // There is only the master interface running on this router. Please note
61 // that because of interface versioning, the other side of the message pipe 63 // that because of interface versioning, the other side of the message pipe
62 // may use a newer master interface definition which passes associated 64 // may use a newer master interface definition which passes associated
63 // interfaces. In that case, this router may still receive pipe control 65 // interfaces. In that case, this router may still receive pipe control
64 // messages or messages targetting associated interfaces. 66 // messages or messages targetting associated interfaces.
65 SINGLE_INTERFACE, 67 SINGLE_INTERFACE,
66 // Similar to the mode above, there is only the master interface running on 68 // Similar to the mode above, there is only the master interface running on
67 // this router. Besides, the master interface has sync methods. 69 // this router. Besides, the master interface has sync methods.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 260
259 bool testing_mode_; 261 bool testing_mode_;
260 262
261 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter); 263 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter);
262 }; 264 };
263 265
264 } // namespace internal 266 } // namespace internal
265 } // namespace mojo 267 } // namespace mojo
266 268
267 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ 269 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/message_internal.h ('k') | mojo/public/cpp/bindings/lib/native_struct_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698