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

Side by Side Diff: mojo/public/cpp/bindings/lib/multiplex_router.h

Issue 2900543002: Mojo C++ bindings: introduce mojo::internal::deque and use it in MultiplexRouter. (Closed)
Patch Set: . Created 3 years, 7 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/lib/deque.h ('k') | mojo/public/cpp/bindings/tests/BUILD.gn » ('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 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>
11 #include <map> 10 #include <map>
12 #include <memory> 11 #include <memory>
13 #include <string> 12 #include <string>
14 13
15 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
16 #include "base/logging.h" 15 #include "base/logging.h"
17 #include "base/macros.h" 16 #include "base/macros.h"
18 #include "base/memory/ref_counted.h" 17 #include "base/memory/ref_counted.h"
19 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
20 #include "base/optional.h" 19 #include "base/optional.h"
21 #include "base/single_thread_task_runner.h" 20 #include "base/single_thread_task_runner.h"
22 #include "base/synchronization/lock.h" 21 #include "base/synchronization/lock.h"
23 #include "base/threading/thread_checker.h" 22 #include "base/threading/thread_checker.h"
24 #include "mojo/public/cpp/bindings/associated_group_controller.h" 23 #include "mojo/public/cpp/bindings/associated_group_controller.h"
25 #include "mojo/public/cpp/bindings/bindings_export.h" 24 #include "mojo/public/cpp/bindings/bindings_export.h"
26 #include "mojo/public/cpp/bindings/connector.h" 25 #include "mojo/public/cpp/bindings/connector.h"
27 #include "mojo/public/cpp/bindings/filter_chain.h" 26 #include "mojo/public/cpp/bindings/filter_chain.h"
28 #include "mojo/public/cpp/bindings/interface_id.h" 27 #include "mojo/public/cpp/bindings/interface_id.h"
28 #include "mojo/public/cpp/bindings/lib/deque.h"
29 #include "mojo/public/cpp/bindings/message_header_validator.h" 29 #include "mojo/public/cpp/bindings/message_header_validator.h"
30 #include "mojo/public/cpp/bindings/pipe_control_message_handler.h" 30 #include "mojo/public/cpp/bindings/pipe_control_message_handler.h"
31 #include "mojo/public/cpp/bindings/pipe_control_message_handler_delegate.h" 31 #include "mojo/public/cpp/bindings/pipe_control_message_handler_delegate.h"
32 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h" 32 #include "mojo/public/cpp/bindings/pipe_control_message_proxy.h"
33 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" 33 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h"
34 34
35 namespace base { 35 namespace base {
36 class SingleThreadTaskRunner; 36 class SingleThreadTaskRunner;
37 } 37 }
38 38
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 // Not set in Config::SINGLE_INTERFACE* mode. 246 // Not set in Config::SINGLE_INTERFACE* mode.
247 mutable base::Optional<base::Lock> lock_; 247 mutable base::Optional<base::Lock> lock_;
248 PipeControlMessageHandler control_message_handler_; 248 PipeControlMessageHandler control_message_handler_;
249 249
250 // NOTE: It is unsafe to call into this object while holding |lock_|. 250 // NOTE: It is unsafe to call into this object while holding |lock_|.
251 PipeControlMessageProxy control_message_proxy_; 251 PipeControlMessageProxy control_message_proxy_;
252 252
253 std::map<InterfaceId, scoped_refptr<InterfaceEndpoint>> endpoints_; 253 std::map<InterfaceId, scoped_refptr<InterfaceEndpoint>> endpoints_;
254 uint32_t next_interface_id_value_; 254 uint32_t next_interface_id_value_;
255 255
256 std::deque<std::unique_ptr<Task>> tasks_; 256 deque<std::unique_ptr<Task>> tasks_;
257 // It refers to tasks in |tasks_| and doesn't own any of them. 257 // It refers to tasks in |tasks_| and doesn't own any of them.
258 std::map<InterfaceId, std::deque<Task*>> sync_message_tasks_; 258 std::map<InterfaceId, deque<Task*>> sync_message_tasks_;
259 259
260 bool posted_to_process_tasks_; 260 bool posted_to_process_tasks_;
261 scoped_refptr<base::SingleThreadTaskRunner> posted_to_task_runner_; 261 scoped_refptr<base::SingleThreadTaskRunner> posted_to_task_runner_;
262 262
263 bool encountered_error_; 263 bool encountered_error_;
264 264
265 bool paused_; 265 bool paused_;
266 266
267 bool testing_mode_; 267 bool testing_mode_;
268 268
269 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter); 269 DISALLOW_COPY_AND_ASSIGN(MultiplexRouter);
270 }; 270 };
271 271
272 } // namespace internal 272 } // namespace internal
273 } // namespace mojo 273 } // namespace mojo
274 274
275 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_ 275 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_MULTIPLEX_ROUTER_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/deque.h ('k') | mojo/public/cpp/bindings/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698