| 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 <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 scoped_refptr<base::SingleThreadTaskRunner> runner) { | 50 scoped_refptr<base::SingleThreadTaskRunner> runner) { |
| 51 DCHECK(!router_); | 51 DCHECK(!router_); |
| 52 internal::FilterChain filters; | 52 internal::FilterChain filters; |
| 53 filters.Append<internal::MessageHeaderValidator>(); | 53 filters.Append<internal::MessageHeaderValidator>(); |
| 54 filters.Append<typename Interface::RequestValidator_>(); | 54 filters.Append<typename Interface::RequestValidator_>(); |
| 55 | 55 |
| 56 router_ = | 56 router_ = |
| 57 new internal::Router(std::move(handle), std::move(filters), | 57 new internal::Router(std::move(handle), std::move(filters), |
| 58 Interface::HasSyncMethods_, std::move(runner)); | 58 Interface::HasSyncMethods_, std::move(runner)); |
| 59 router_->set_incoming_receiver(&stub_); | 59 router_->set_incoming_receiver(&stub_); |
| 60 router_->set_interface_name(Interface::Name_); |
| 60 router_->set_connection_error_handler( | 61 router_->set_connection_error_handler( |
| 61 [this]() { connection_error_handler_.Run(); }); | 62 [this]() { connection_error_handler_.Run(); }); |
| 62 } | 63 } |
| 63 | 64 |
| 64 bool HasAssociatedInterfaces() const { return false; } | 65 bool HasAssociatedInterfaces() const { return false; } |
| 65 | 66 |
| 66 void PauseIncomingMethodCallProcessing() { | 67 void PauseIncomingMethodCallProcessing() { |
| 67 DCHECK(router_); | 68 DCHECK(router_); |
| 68 router_->PauseIncomingMethodCallProcessing(); | 69 router_->PauseIncomingMethodCallProcessing(); |
| 69 } | 70 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 router_ = new internal::MultiplexRouter(false, std::move(handle), runner); | 149 router_ = new internal::MultiplexRouter(false, std::move(handle), runner); |
| 149 stub_.serialization_context()->router = router_; | 150 stub_.serialization_context()->router = router_; |
| 150 | 151 |
| 151 endpoint_client_.reset(new internal::InterfaceEndpointClient( | 152 endpoint_client_.reset(new internal::InterfaceEndpointClient( |
| 152 router_->CreateLocalEndpointHandle(internal::kMasterInterfaceId), | 153 router_->CreateLocalEndpointHandle(internal::kMasterInterfaceId), |
| 153 &stub_, base::WrapUnique(new typename Interface::RequestValidator_()), | 154 &stub_, base::WrapUnique(new typename Interface::RequestValidator_()), |
| 154 Interface::HasSyncMethods_, std::move(runner))); | 155 Interface::HasSyncMethods_, std::move(runner))); |
| 155 | 156 |
| 156 endpoint_client_->set_connection_error_handler( | 157 endpoint_client_->set_connection_error_handler( |
| 157 [this]() { connection_error_handler_.Run(); }); | 158 [this]() { connection_error_handler_.Run(); }); |
| 159 endpoint_client_->set_interface_name(Interface::Name_); |
| 158 } | 160 } |
| 159 | 161 |
| 160 bool HasAssociatedInterfaces() const { | 162 bool HasAssociatedInterfaces() const { |
| 161 return router_ ? router_->HasAssociatedEndpoints() : false; | 163 return router_ ? router_->HasAssociatedEndpoints() : false; |
| 162 } | 164 } |
| 163 | 165 |
| 164 void PauseIncomingMethodCallProcessing() { | 166 void PauseIncomingMethodCallProcessing() { |
| 165 DCHECK(router_); | 167 DCHECK(router_); |
| 166 router_->PauseIncomingMethodCallProcessing(); | 168 router_->PauseIncomingMethodCallProcessing(); |
| 167 } | 169 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 Interface* impl_; | 228 Interface* impl_; |
| 227 Closure connection_error_handler_; | 229 Closure connection_error_handler_; |
| 228 | 230 |
| 229 DISALLOW_COPY_AND_ASSIGN(BindingState); | 231 DISALLOW_COPY_AND_ASSIGN(BindingState); |
| 230 }; | 232 }; |
| 231 | 233 |
| 232 } // namesapce internal | 234 } // namesapce internal |
| 233 } // namespace mojo | 235 } // namespace mojo |
| 234 | 236 |
| 235 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ | 237 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_BINDING_STATE_H_ |
| OLD | NEW |