| 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_INTERFACE_PTR_INFO_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_INFO_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_INFO_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_INFO_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return std::move(handle_); | 50 return std::move(handle_); |
| 51 } | 51 } |
| 52 const ScopedInterfaceEndpointHandle& handle() const { return handle_; } | 52 const ScopedInterfaceEndpointHandle& handle() const { return handle_; } |
| 53 void set_handle(ScopedInterfaceEndpointHandle handle) { | 53 void set_handle(ScopedInterfaceEndpointHandle handle) { |
| 54 handle_ = std::move(handle); | 54 handle_ = std::move(handle); |
| 55 } | 55 } |
| 56 | 56 |
| 57 uint32_t version() const { return version_; } | 57 uint32_t version() const { return version_; } |
| 58 void set_version(uint32_t version) { version_ = version; } | 58 void set_version(uint32_t version) { version_ = version; } |
| 59 | 59 |
| 60 bool Equals(const AssociatedInterfacePtrInfo& other) const { |
| 61 if (this == &other) |
| 62 return true; |
| 63 |
| 64 // Now that the two refer to different objects, they are equivalent if |
| 65 // and only if they are both invalid. |
| 66 return !is_valid() && !other.is_valid(); |
| 67 } |
| 68 |
| 60 private: | 69 private: |
| 61 ScopedInterfaceEndpointHandle handle_; | 70 ScopedInterfaceEndpointHandle handle_; |
| 62 uint32_t version_; | 71 uint32_t version_; |
| 63 }; | 72 }; |
| 64 | 73 |
| 65 } // namespace mojo | 74 } // namespace mojo |
| 66 | 75 |
| 67 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_INFO_H_ | 76 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_INFO_H_ |
| OLD | NEW |