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

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

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
« no previous file with comments | « mojo/public/cpp/bindings/lib/binding_state.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_INTERFACE_PTR_STATE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> // For |std::swap()|. 10 #include <algorithm> // For |std::swap()|.
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 // The proxy has been configured. 338 // The proxy has been configured.
339 if (proxy_) { 339 if (proxy_) {
340 DCHECK(router_); 340 DCHECK(router_);
341 DCHECK(endpoint_client_); 341 DCHECK(endpoint_client_);
342 return; 342 return;
343 } 343 }
344 // The object hasn't been bound. 344 // The object hasn't been bound.
345 if (!handle_.is_valid()) 345 if (!handle_.is_valid())
346 return; 346 return;
347 347
348 router_ = new MultiplexRouter( 348 MultiplexRouter::Config config =
349 std::move(handle_), MultiplexRouter::MULTI_INTERFACE, true, runner_); 349 Interface::PassesAssociatedKinds_
350 ? MultiplexRouter::MULTI_INTERFACE
351 : (Interface::HasSyncMethods_
352 ? MultiplexRouter::SINGLE_INTERFACE_WITH_SYNC_METHODS
353 : MultiplexRouter::SINGLE_INTERFACE);
354 router_ = new MultiplexRouter(std::move(handle_), config, true, runner_);
350 router_->SetMasterInterfaceName(Interface::Name_); 355 router_->SetMasterInterfaceName(Interface::Name_);
351 endpoint_client_.reset(new InterfaceEndpointClient( 356 endpoint_client_.reset(new InterfaceEndpointClient(
352 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr, 357 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr,
353 base::WrapUnique(new typename Interface::ResponseValidator_()), false, 358 base::WrapUnique(new typename Interface::ResponseValidator_()), false,
354 std::move(runner_), 359 std::move(runner_),
355 // The version is only queried from the client so the value passed here 360 // The version is only queried from the client so the value passed here
356 // will not be used. 361 // will not be used.
357 0u)); 362 0u));
358 proxy_.reset(new Proxy(endpoint_client_.get())); 363 proxy_.reset(new Proxy(endpoint_client_.get()));
359 proxy_->serialization_context()->group_controller = 364 proxy_->serialization_context()->group_controller =
(...skipping 19 matching lines...) Expand all
379 384
380 uint32_t version_; 385 uint32_t version_;
381 386
382 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); 387 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState);
383 }; 388 };
384 389
385 } // namespace internal 390 } // namespace internal
386 } // namespace mojo 391 } // namespace mojo
387 392
388 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ 393 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/binding_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698