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

Side by Side Diff: mojo/public/cpp/bindings/lib/binding_state.cc

Issue 2608163003: Change single-interface mojo bindings to use SequencedTaskRunner. (Closed)
Patch Set: Created 3 years, 10 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/binding_state.h ('k') | mojo/public/cpp/bindings/lib/connector.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "mojo/public/cpp/bindings/lib/binding_state.h" 5 #include "mojo/public/cpp/bindings/lib/binding_state.h"
6 6
7 #include "mojo/public/cpp/bindings/lib/control_message_proxy.h" 7 #include "mojo/public/cpp/bindings/lib/control_message_proxy.h"
8 8
9 namespace mojo { 9 namespace mojo {
10 namespace internal { 10 namespace internal {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 endpoint_client_->control_message_proxy()->FlushForTesting(); 57 endpoint_client_->control_message_proxy()->FlushForTesting();
58 } 58 }
59 59
60 void BindingStateBase::EnableTestingMode() { 60 void BindingStateBase::EnableTestingMode() {
61 DCHECK(is_bound()); 61 DCHECK(is_bound());
62 router_->EnableTestingMode(); 62 router_->EnableTestingMode();
63 } 63 }
64 64
65 void BindingStateBase::BindInternal( 65 void BindingStateBase::BindInternal(
66 ScopedMessagePipeHandle handle, 66 ScopedMessagePipeHandle handle,
67 scoped_refptr<base::SingleThreadTaskRunner> runner, 67 scoped_refptr<base::SequencedTaskRunner> runner,
68 const char* interface_name, 68 const char* interface_name,
69 std::unique_ptr<MessageReceiver> request_validator, 69 std::unique_ptr<MessageReceiver> request_validator,
70 bool passes_associated_kinds, 70 bool passes_associated_kinds,
71 bool has_sync_methods, 71 bool has_sync_methods,
72 MessageReceiverWithResponderStatus* stub, 72 MessageReceiverWithResponderStatus* stub,
73 uint32_t interface_version) { 73 uint32_t interface_version) {
74 DCHECK(!router_); 74 DCHECK(!router_);
75 75
76 MultiplexRouter::Config config = 76 MultiplexRouter::Config config =
77 passes_associated_kinds 77 passes_associated_kinds
78 ? MultiplexRouter::MULTI_INTERFACE 78 ? MultiplexRouter::MULTI_INTERFACE
79 : (has_sync_methods 79 : (has_sync_methods
80 ? MultiplexRouter::SINGLE_INTERFACE_WITH_SYNC_METHODS 80 ? MultiplexRouter::SINGLE_INTERFACE_WITH_SYNC_METHODS
81 : MultiplexRouter::SINGLE_INTERFACE); 81 : MultiplexRouter::SINGLE_INTERFACE);
82 router_ = new MultiplexRouter(std::move(handle), config, false, runner); 82 router_ = new MultiplexRouter(std::move(handle), config, false, runner);
83 router_->SetMasterInterfaceName(interface_name); 83 router_->SetMasterInterfaceName(interface_name);
84 84
85 endpoint_client_.reset(new InterfaceEndpointClient( 85 endpoint_client_.reset(new InterfaceEndpointClient(
86 router_->CreateLocalEndpointHandle(kMasterInterfaceId), stub, 86 router_->CreateLocalEndpointHandle(kMasterInterfaceId), stub,
87 std::move(request_validator), has_sync_methods, std::move(runner), 87 std::move(request_validator), has_sync_methods, std::move(runner),
88 interface_version)); 88 interface_version));
89 } 89 }
90 90
91 } // namesapce internal 91 } // namesapce internal
92 } // namespace mojo 92 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/binding_state.h ('k') | mojo/public/cpp/bindings/lib/connector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698