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 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" | 12 #include "mojo/public/cpp/bindings/scoped_interface_endpoint_handle.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 | 15 |
16 // AssociatedInterfacePtrInfo stores necessary information to construct an | 16 // AssociatedInterfacePtrInfo stores necessary information to construct an |
17 // associated interface pointer. It is similar to InterfacePtrInfo except that | 17 // associated interface pointer. It is similar to InterfacePtrInfo except that |
18 // it doesn't own a message pipe handle. | 18 // it doesn't own a message pipe handle. |
19 template <typename Interface> | 19 template <typename Interface> |
20 class AssociatedInterfacePtrInfo { | 20 class AssociatedInterfacePtrInfo { |
21 public: | 21 public: |
22 AssociatedInterfacePtrInfo() : version_(0u) {} | 22 AssociatedInterfacePtrInfo() : version_(0u) {} |
23 AssociatedInterfacePtrInfo(decltype(nullptr)) : version_(0u) {} | |
cmumford
2016/10/11 18:30:54
Should use std::nullptr_t here.
However, I believ
Reilly Grant (use Gerrit)
2016/10/11 23:46:13
The goal is to make AssociatedPtrInfo behave ident
| |
23 | 24 |
24 AssociatedInterfacePtrInfo(AssociatedInterfacePtrInfo&& other) | 25 AssociatedInterfacePtrInfo(AssociatedInterfacePtrInfo&& other) |
25 : handle_(std::move(other.handle_)), version_(other.version_) { | 26 : handle_(std::move(other.handle_)), version_(other.version_) { |
26 other.version_ = 0u; | 27 other.version_ = 0u; |
27 } | 28 } |
28 | 29 |
29 AssociatedInterfacePtrInfo(ScopedInterfaceEndpointHandle handle, | 30 AssociatedInterfacePtrInfo(ScopedInterfaceEndpointHandle handle, |
30 uint32_t version) | 31 uint32_t version) |
31 : handle_(std::move(handle)), version_(version) {} | 32 : handle_(std::move(handle)), version_(version) {} |
32 | 33 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 private: | 68 private: |
68 ScopedInterfaceEndpointHandle handle_; | 69 ScopedInterfaceEndpointHandle handle_; |
69 uint32_t version_; | 70 uint32_t version_; |
70 | 71 |
71 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrInfo); | 72 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrInfo); |
72 }; | 73 }; |
73 | 74 |
74 } // namespace mojo | 75 } // namespace mojo |
75 | 76 |
76 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_INFO_H_ | 77 #endif // MOJO_PUBLIC_CPP_BINDINGS_ASSOCIATED_INTERFACE_PTR_INFO_H_ |
OLD | NEW |