OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BINDING_STATE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 void Bind(ScopedMessagePipeHandle handle) { | 144 void Bind(ScopedMessagePipeHandle handle) { |
145 DCHECK(!router_); | 145 DCHECK(!router_); |
146 | 146 |
147 router_ = new internal::MultiplexRouter(false, std::move(handle)); | 147 router_ = new internal::MultiplexRouter(false, std::move(handle)); |
148 stub_.serialization_context()->router = router_; | 148 stub_.serialization_context()->router = router_; |
149 | 149 |
150 endpoint_client_.reset(new internal::InterfaceEndpointClient( | 150 endpoint_client_.reset(new internal::InterfaceEndpointClient( |
151 router_->CreateLocalEndpointHandle(internal::kMasterInterfaceId), | 151 router_->CreateLocalEndpointHandle(internal::kMasterInterfaceId), |
152 &stub_, make_scoped_ptr(new typename Interface::RequestValidator_()))); | 152 &stub_, make_scoped_ptr(new typename Interface::RequestValidator_()), |
| 153 Interface::HasSyncMethods_)); |
153 | 154 |
154 endpoint_client_->set_connection_error_handler( | 155 endpoint_client_->set_connection_error_handler( |
155 [this]() { connection_error_handler_.Run(); }); | 156 [this]() { connection_error_handler_.Run(); }); |
156 } | 157 } |
157 | 158 |
158 bool HasAssociatedInterfaces() const { | 159 bool HasAssociatedInterfaces() const { |
159 return router_ ? router_->HasAssociatedEndpoints() : false; | 160 return router_ ? router_->HasAssociatedEndpoints() : false; |
160 } | 161 } |
161 | 162 |
162 void PauseIncomingMethodCallProcessing() { | 163 void PauseIncomingMethodCallProcessing() { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 Interface* impl_; | 223 Interface* impl_; |
223 Closure connection_error_handler_; | 224 Closure connection_error_handler_; |
224 | 225 |
225 DISALLOW_COPY_AND_ASSIGN(BindingState); | 226 DISALLOW_COPY_AND_ASSIGN(BindingState); |
226 }; | 227 }; |
227 | 228 |
228 } // namesapce internal | 229 } // namesapce internal |
229 } // namespace mojo | 230 } // namespace mojo |
230 | 231 |
231 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ | 232 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ |
OLD | NEW |