| 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 <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 << "The AssociatedInterfaceRequest is supposed to be used at the " | 73 << "The AssociatedInterfaceRequest is supposed to be used at the " |
| 74 << "other side of the message pipe."; | 74 << "other side of the message pipe."; |
| 75 | 75 |
| 76 if (!handle.is_valid() || !handle.is_local()) { | 76 if (!handle.is_valid() || !handle.is_local()) { |
| 77 endpoint_client_.reset(); | 77 endpoint_client_.reset(); |
| 78 return; | 78 return; |
| 79 } | 79 } |
| 80 | 80 |
| 81 endpoint_client_.reset(new internal::InterfaceEndpointClient( | 81 endpoint_client_.reset(new internal::InterfaceEndpointClient( |
| 82 std::move(handle), &stub_, | 82 std::move(handle), &stub_, |
| 83 make_scoped_ptr(new typename Interface::RequestValidator_()))); | 83 make_scoped_ptr(new typename Interface::RequestValidator_()), |
| 84 Interface::HasSyncMethods_)); |
| 84 endpoint_client_->set_connection_error_handler( | 85 endpoint_client_->set_connection_error_handler( |
| 85 [this]() { connection_error_handler_.Run(); }); | 86 [this]() { connection_error_handler_.Run(); }); |
| 86 | 87 |
| 87 stub_.serialization_context()->router = endpoint_client_->router(); | 88 stub_.serialization_context()->router = endpoint_client_->router(); |
| 88 } | 89 } |
| 89 | 90 |
| 90 // Closes the associated interface. Puts this object into a state where it can | 91 // Closes the associated interface. Puts this object into a state where it can |
| 91 // be rebound. | 92 // be rebound. |
| 92 void Close() { | 93 void Close() { |
| 93 DCHECK(endpoint_client_); | 94 DCHECK(endpoint_client_); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 typename Interface::Stub_ stub_; | 140 typename Interface::Stub_ stub_; |
| 140 Interface* impl_; | 141 Interface* impl_; |
| 141 Closure connection_error_handler_; | 142 Closure connection_error_handler_; |
| 142 | 143 |
| 143 DISALLOW_COPY_AND_ASSIGN(AssociatedBinding); | 144 DISALLOW_COPY_AND_ASSIGN(AssociatedBinding); |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 } // namespace mojo | 147 } // namespace mojo |
| 147 | 148 |
| 148 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ | 149 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ |
| OLD | NEW |