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

Side by Side Diff: mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h

Issue 2492463005: Mojo C++ bindings: reduce references to AssociatedGroupController. (Closed)
Patch Set: . Created 4 years, 1 month 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_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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 DCHECK(info.is_valid()); 95 DCHECK(info.is_valid());
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 proxy_->serialization_context()->group_controller = 105 if (Interface::PassesAssociatedKinds_) {
106 endpoint_client_->group_controller(); 106 proxy_->serialization_context()->group_controller =
107 endpoint_client_->group_controller();
108 }
107 } 109 }
108 110
109 // After this method is called, the object is in an invalid state and 111 // After this method is called, the object is in an invalid state and
110 // shouldn't be reused. 112 // shouldn't be reused.
111 AssociatedInterfacePtrInfo<Interface> PassInterface() { 113 AssociatedInterfacePtrInfo<Interface> PassInterface() {
112 ScopedInterfaceEndpointHandle handle = endpoint_client_->PassHandle(); 114 ScopedInterfaceEndpointHandle handle = endpoint_client_->PassHandle();
113 endpoint_client_.reset(); 115 endpoint_client_.reset();
114 proxy_.reset(); 116 proxy_.reset();
115 return AssociatedInterfacePtrInfo<Interface>(std::move(handle), version_); 117 return AssociatedInterfacePtrInfo<Interface>(std::move(handle), version_);
116 } 118 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 157
156 uint32_t version_; 158 uint32_t version_;
157 159
158 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState); 160 DISALLOW_COPY_AND_ASSIGN(AssociatedInterfacePtrState);
159 }; 161 };
160 162
161 } // namespace internal 163 } // namespace internal
162 } // namespace mojo 164 } // namespace mojo
163 165
164 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_ 166 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ASSOCIATED_INTERFACE_PTR_STATE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/associated_binding.h ('k') | mojo/public/cpp/bindings/lib/binding_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698