Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Side by Side Diff: mojo/public/cpp/bindings/associated_interface_ptr_info.h

Issue 2370643004: Port messages sent by WebIDBFactoryImpl to Mojo. (Closed)
Patch Set: Require explicit wrapping when discarding map keys. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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) {}
dcheng 2016/10/17 05:33:44 Nit: nullptr_t
Reilly Grant (use Gerrit) 2016/10/19 00:36:51 Done.
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698