| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return; | 67 return; |
| 68 | 68 |
| 69 version_ = version; | 69 version_ = version; |
| 70 endpoint_client_->control_message_proxy()->RequireVersion(version); | 70 endpoint_client_->control_message_proxy()->RequireVersion(version); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void FlushForTesting() { | 73 void FlushForTesting() { |
| 74 endpoint_client_->control_message_proxy()->FlushForTesting(); | 74 endpoint_client_->control_message_proxy()->FlushForTesting(); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void SendDisconnectReason(uint32_t custom_reason, | 77 void CloseWithReason(uint32_t custom_reason, const std::string& description) { |
| 78 const std::string& description) { | 78 endpoint_client_->CloseWithReason(custom_reason, description); |
| 79 endpoint_client_->control_message_proxy()->SendDisconnectReason( | |
| 80 custom_reason, description); | |
| 81 } | 79 } |
| 82 | 80 |
| 83 void Swap(AssociatedInterfacePtrState* other) { | 81 void Swap(AssociatedInterfacePtrState* other) { |
| 84 using std::swap; | 82 using std::swap; |
| 85 swap(other->endpoint_client_, endpoint_client_); | 83 swap(other->endpoint_client_, endpoint_client_); |
| 86 swap(other->proxy_, proxy_); | 84 swap(other->proxy_, proxy_); |
| 87 swap(other->version_, version_); | 85 swap(other->version_, version_); |
| 88 } | 86 } |
| 89 | 87 |
| 90 void Bind(AssociatedInterfacePtrInfo<Interface> info, | 88 void Bind(AssociatedInterfacePtrInfo<Interface> info, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 161 |
| 164 uint32_t version_; | 162 uint32_t version_; |
| 165 | 163 |
| 166 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState); | 164 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState); |
| 167 }; | 165 }; |
| 168 | 166 |
| 169 } // namespace internal | 167 } // namespace internal |
| 170 } // namespace mojo | 168 } // namespace mojo |
| 171 | 169 |
| 172 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ | 170 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ |
| OLD | NEW |