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

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

Issue 2349293002: Mojo C++ bindings: always use MultiplexRouter with InterfacePtr/Binding. (Closed)
Patch Set: . Created 4 years, 3 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 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 void MultiplexedBindingState::EnableTestingMode() { 134 void MultiplexedBindingState::EnableTestingMode() {
135 DCHECK(is_bound()); 135 DCHECK(is_bound());
136 router_->EnableTestingMode(); 136 router_->EnableTestingMode();
137 } 137 }
138 138
139 void MultiplexedBindingState::BindInternal( 139 void MultiplexedBindingState::BindInternal(
140 ScopedMessagePipeHandle handle, 140 ScopedMessagePipeHandle handle,
141 scoped_refptr<base::SingleThreadTaskRunner> runner, 141 scoped_refptr<base::SingleThreadTaskRunner> runner,
142 const char* interface_name, 142 const char* interface_name,
143 std::unique_ptr<MessageReceiver> request_validator, 143 std::unique_ptr<MessageReceiver> request_validator,
144 bool passes_associated_kinds,
144 bool has_sync_methods, 145 bool has_sync_methods,
145 MessageReceiverWithResponderStatus* stub, 146 MessageReceiverWithResponderStatus* stub,
146 uint32_t interface_version) { 147 uint32_t interface_version) {
147 DCHECK(!router_); 148 DCHECK(!router_);
148 149
149 router_ = new MultiplexRouter( 150 MultiplexRouter::Config config =
150 std::move(handle), MultiplexRouter::MULTI_INTERFACE, false, runner); 151 passes_associated_kinds
152 ? MultiplexRouter::MULTI_INTERFACE
153 : (has_sync_methods
154 ? MultiplexRouter::SINGLE_INTERFACE_WITH_SYNC_METHODS
155 : MultiplexRouter::SINGLE_INTERFACE);
156 router_ = new MultiplexRouter(std::move(handle), config, false, runner);
151 router_->SetMasterInterfaceName(interface_name); 157 router_->SetMasterInterfaceName(interface_name);
152 158
153 endpoint_client_.reset(new InterfaceEndpointClient( 159 endpoint_client_.reset(new InterfaceEndpointClient(
154 router_->CreateLocalEndpointHandle(kMasterInterfaceId), stub, 160 router_->CreateLocalEndpointHandle(kMasterInterfaceId), stub,
155 std::move(request_validator), has_sync_methods, std::move(runner), 161 std::move(request_validator), has_sync_methods, std::move(runner),
156 interface_version)); 162 interface_version));
157 } 163 }
158 164
159 } // namesapce internal 165 } // namesapce internal
160 } // namespace mojo 166 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/binding_state.h ('k') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698