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_ASSOCIATED_BINDING_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 endpoint_client_.reset(); | 96 endpoint_client_.reset(); |
97 return; | 97 return; |
98 } | 98 } |
99 | 99 |
100 endpoint_client_.reset(new internal::InterfaceEndpointClient( | 100 endpoint_client_.reset(new internal::InterfaceEndpointClient( |
101 std::move(handle), &stub_, | 101 std::move(handle), &stub_, |
102 base::WrapUnique(new typename Interface::RequestValidator_()), | 102 base::WrapUnique(new typename Interface::RequestValidator_()), |
103 Interface::HasSyncMethods_, std::move(runner))); | 103 Interface::HasSyncMethods_, std::move(runner))); |
104 endpoint_client_->set_connection_error_handler( | 104 endpoint_client_->set_connection_error_handler( |
105 [this]() { connection_error_handler_.Run(); }); | 105 [this]() { connection_error_handler_.Run(); }); |
| 106 endpoint_client_->set_interface_name(Interface::Name_); |
106 | 107 |
107 stub_.serialization_context()->router = endpoint_client_->router(); | 108 stub_.serialization_context()->router = endpoint_client_->router(); |
108 } | 109 } |
109 | 110 |
110 // Closes the associated interface. Puts this object into a state where it can | 111 // Closes the associated interface. Puts this object into a state where it can |
111 // be rebound. | 112 // be rebound. |
112 void Close() { | 113 void Close() { |
113 DCHECK(endpoint_client_); | 114 DCHECK(endpoint_client_); |
114 endpoint_client_.reset(); | 115 endpoint_client_.reset(); |
115 connection_error_handler_.reset(); | 116 connection_error_handler_.reset(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 typename Interface::Stub_ stub_; | 159 typename Interface::Stub_ stub_; |
159 Interface* impl_; | 160 Interface* impl_; |
160 Closure connection_error_handler_; | 161 Closure connection_error_handler_; |
161 | 162 |
162 DISALLOW_COPY_AND_ASSIGN(AssociatedBinding); | 163 DISALLOW_COPY_AND_ASSIGN(AssociatedBinding); |
163 }; | 164 }; |
164 | 165 |
165 } // namespace mojo | 166 } // namespace mojo |
166 | 167 |
167 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ | 168 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ |
OLD | NEW |