OLD | NEW |
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/logging.h" | 15 #include "base/logging.h" |
16 #include "base/macros.h" | 16 #include "base/macros.h" |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
20 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
21 #include "base/threading/thread_checker.h" | 21 #include "base/threading/thread_checker.h" |
22 #include "mojo/public/cpp/bindings/associated_group_controller.h" | 22 #include "mojo/public/cpp/bindings/associated_group_controller.h" |
23 #include "mojo/public/cpp/bindings/connector.h" | 23 #include "mojo/public/cpp/bindings/connector.h" |
| 24 #include "mojo/public/cpp/bindings/filter_chain.h" |
24 #include "mojo/public/cpp/bindings/interface_id.h" | 25 #include "mojo/public/cpp/bindings/interface_id.h" |
25 #include "mojo/public/cpp/bindings/message_header_validator.h" | 26 #include "mojo/public/cpp/bindings/message_header_validator.h" |
26 #include "mojo/public/cpp/bindings/pipe_control_message_handler.h" | 27 #include "mojo/public/cpp/bindings/pipe_control_message_handler.h" |
27 #include "mojo/public/cpp/bindings/pipe_control_message_handler_delegate.h" | 28 #include "mojo/public/cpp/bindings/pipe_control_message_handler_delegate.h" |
28 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h" | 29 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h" |
29 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 30 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
30 | 31 |
31 namespace base { | 32 namespace base { |
32 class SingleThreadTaskRunner; | 33 class SingleThreadTaskRunner; |
33 } | 34 } |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void RaiseErrorInNonTestingMode(); | 200 void RaiseErrorInNonTestingMode(); |
200 | 201 |
201 InterfaceEndpoint* FindOrInsertEndpoint(InterfaceId id, bool* inserted); | 202 InterfaceEndpoint* FindOrInsertEndpoint(InterfaceId id, bool* inserted); |
202 | 203 |
203 // Whether to set the namespace bit when generating interface IDs. Please see | 204 // Whether to set the namespace bit when generating interface IDs. Please see |
204 // comments of kInterfaceIdNamespaceMask. | 205 // comments of kInterfaceIdNamespaceMask. |
205 const bool set_interface_id_namespace_bit_; | 206 const bool set_interface_id_namespace_bit_; |
206 | 207 |
207 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 208 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
208 | 209 |
209 MessageHeaderValidator header_validator_; | 210 // Owned by |filters_| below. |
| 211 MessageHeaderValidator* header_validator_; |
| 212 |
| 213 FilterChain filters_; |
210 Connector connector_; | 214 Connector connector_; |
211 | 215 |
212 base::ThreadChecker thread_checker_; | 216 base::ThreadChecker thread_checker_; |
213 | 217 |
214 // Protects the following members. | 218 // Protects the following members. |
215 mutable base::Lock lock_; | 219 mutable base::Lock lock_; |
216 PipeControlMessageHandler control_message_handler_; | 220 PipeControlMessageHandler control_message_handler_; |
217 PipeControlMessageProxy control_message_proxy_; | 221 PipeControlMessageProxy control_message_proxy_; |
218 | 222 |
219 std::map<InterfaceId, scoped_refptr<InterfaceEndpoint>> endpoints_; | 223 std::map<InterfaceId, scoped_refptr<InterfaceEndpoint>> endpoints_; |
(...skipping 12 matching lines...) Expand all Loading... |
232 | 236 |
233 bool testing_mode_; | 237 bool testing_mode_; |
234 | 238 |
235 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter); | 239 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter); |
236 }; | 240 }; |
237 | 241 |
238 } // namespace internal | 242 } // namespace internal |
239 } // namespace mojo | 243 } // namespace mojo |
240 | 244 |
241 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ | 245 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ |
OLD | NEW |