| 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_ASSOCIATED_INTERFACE_PTR_STATE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> // For |std::swap()|. | 10 #include <algorithm> // For |std::swap()|. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 version_ = info.version(); | 97 version_ = info.version(); |
| 98 // The version is only queried from the client so the value passed here | 98 // The version is only queried from the client so the value passed here |
| 99 // will not be used. | 99 // will not be used. |
| 100 endpoint_client_.reset(new InterfaceEndpointClient( | 100 endpoint_client_.reset(new InterfaceEndpointClient( |
| 101 info.PassHandle(), nullptr, | 101 info.PassHandle(), nullptr, |
| 102 base::WrapUnique(new typename Interface::ResponseValidator_()), false, | 102 base::WrapUnique(new typename Interface::ResponseValidator_()), false, |
| 103 std::move(runner), 0u)); | 103 std::move(runner), 0u)); |
| 104 proxy_.reset(new Proxy(endpoint_client_.get())); | 104 proxy_.reset(new Proxy(endpoint_client_.get())); |
| 105 if (Interface::PassesAssociatedKinds_) { | 105 if (Interface::PassesAssociatedKinds_) { |
| 106 proxy_->serialization_context()->group_controller = | 106 proxy_->set_group_controller(endpoint_client_->group_controller()); |
| 107 endpoint_client_->group_controller(); | |
| 108 } | 107 } |
| 109 } | 108 } |
| 110 | 109 |
| 111 // After this method is called, the object is in an invalid state and | 110 // After this method is called, the object is in an invalid state and |
| 112 // shouldn't be reused. | 111 // shouldn't be reused. |
| 113 AssociatedInterfacePtrInfo<Interface> PassInterface() { | 112 AssociatedInterfacePtrInfo<Interface> PassInterface() { |
| 114 ScopedInterfaceEndpointHandle handle = endpoint_client_->PassHandle(); | 113 ScopedInterfaceEndpointHandle handle = endpoint_client_->PassHandle(); |
| 115 endpoint_client_.reset(); | 114 endpoint_client_.reset(); |
| 116 proxy_.reset(); | 115 proxy_.reset(); |
| 117 return AssociatedInterfacePtrInfo<Interface>(std::move(handle), version_); | 116 return AssociatedInterfacePtrInfo<Interface>(std::move(handle), version_); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 156 |
| 158 uint32_t version_; | 157 uint32_t version_; |
| 159 | 158 |
| 160 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState); | 159 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState); |
| 161 }; | 160 }; |
| 162 | 161 |
| 163 } // namespace internal | 162 } // namespace internal |
| 164 } // namespace mojo | 163 } // namespace mojo |
| 165 | 164 |
| 166 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ | 165 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ |
| OLD | NEW |