OLD | NEW |
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 Loading... |
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 |
OLD | NEW |