| 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 <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (!handle.is_valid() || !handle.is_local()) { | 103 if (!handle.is_valid() || !handle.is_local()) { |
| 104 endpoint_client_.reset(); | 104 endpoint_client_.reset(); |
| 105 return; | 105 return; |
| 106 } | 106 } |
| 107 | 107 |
| 108 endpoint_client_.reset(new InterfaceEndpointClient( | 108 endpoint_client_.reset(new InterfaceEndpointClient( |
| 109 std::move(handle), &stub_, | 109 std::move(handle), &stub_, |
| 110 base::WrapUnique(new typename Interface::RequestValidator_()), | 110 base::WrapUnique(new typename Interface::RequestValidator_()), |
| 111 Interface::HasSyncMethods_, std::move(runner), Interface::Version_)); | 111 Interface::HasSyncMethods_, std::move(runner), Interface::Version_)); |
| 112 | 112 |
| 113 stub_.serialization_context()->group_controller = | 113 if (Interface::PassesAssociatedKinds_) { |
| 114 endpoint_client_->group_controller(); | 114 stub_.serialization_context()->group_controller = |
| 115 endpoint_client_->group_controller(); |
| 116 } |
| 115 } | 117 } |
| 116 | 118 |
| 117 // Adds a message filter to be notified of each incoming message before | 119 // Adds a message filter to be notified of each incoming message before |
| 118 // dispatch. If a filter returns |false| from Accept(), the message is not | 120 // dispatch. If a filter returns |false| from Accept(), the message is not |
| 119 // dispatched and the pipe is closed. Filters cannot be removed. | 121 // dispatched and the pipe is closed. Filters cannot be removed. |
| 120 void AddFilter(std::unique_ptr<MessageReceiver> filter) { | 122 void AddFilter(std::unique_ptr<MessageReceiver> filter) { |
| 121 DCHECK(endpoint_client_); | 123 DCHECK(endpoint_client_); |
| 122 endpoint_client_->AddFilter(std::move(filter)); | 124 endpoint_client_->AddFilter(std::move(filter)); |
| 123 } | 125 } |
| 124 | 126 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 private: | 192 private: |
| 191 std::unique_ptr<InterfaceEndpointClient> endpoint_client_; | 193 std::unique_ptr<InterfaceEndpointClient> endpoint_client_; |
| 192 typename Interface::template Stub_<ImplRefTraits> stub_; | 194 typename Interface::template Stub_<ImplRefTraits> stub_; |
| 193 | 195 |
| 194 DISALLOW_COPY_AND_ASSIGN(AssociatedBinding); | 196 DISALLOW_COPY_AND_ASSIGN(AssociatedBinding); |
| 195 }; | 197 }; |
| 196 | 198 |
| 197 } // namespace mojo | 199 } // namespace mojo |
| 198 | 200 |
| 199 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ | 201 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_BINDING_H_ |
| OLD | NEW |