OLD | NEW |
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 Loading... |
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(std::move(handle_), | 348 router_ = new MultiplexRouter( |
349 Interface::PassesAssociatedKinds_ | 349 std::move(handle_), MultiplexRouter::MULTI_INTERFACE, true, runner_); |
350 ? MultiplexRouter::MULTI_INTERFACE | |
351 : MultiplexRouter::SINGLE_INTERFACE, | |
352 true, runner_); | |
353 router_->SetMasterInterfaceName(Interface::Name_); | 350 router_->SetMasterInterfaceName(Interface::Name_); |
354 endpoint_client_.reset(new InterfaceEndpointClient( | 351 endpoint_client_.reset(new InterfaceEndpointClient( |
355 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr, | 352 router_->CreateLocalEndpointHandle(kMasterInterfaceId), nullptr, |
356 base::WrapUnique(new typename Interface::ResponseValidator_()), false, | 353 base::WrapUnique(new typename Interface::ResponseValidator_()), false, |
357 std::move(runner_), | 354 std::move(runner_), |
358 // The version is only queried from the client so the value passed here | 355 // The version is only queried from the client so the value passed here |
359 // will not be used. | 356 // will not be used. |
360 0u)); | 357 0u)); |
361 proxy_.reset(new Proxy(endpoint_client_.get())); | 358 proxy_.reset(new Proxy(endpoint_client_.get())); |
362 proxy_->serialization_context()->group_controller = | 359 proxy_->serialization_context()->group_controller = |
(...skipping 19 matching lines...) Expand all Loading... |
382 | 379 |
383 uint32_t version_; | 380 uint32_t version_; |
384 | 381 |
385 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); | 382 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); |
386 }; | 383 }; |
387 | 384 |
388 } // namespace internal | 385 } // namespace internal |
389 } // namespace mojo | 386 } // namespace mojo |
390 | 387 |
391 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ | 388 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ |
OLD | NEW |