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

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

Issue 1576283002: mojo: Remove Pass() from MOJO_MOVE_ONLY_TYPE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mojopass: morewindows Created 4 years, 11 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
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/system/macros.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_INTERFACE_PTR_STATE_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> // For |std::swap()|. 9 #include <algorithm> // For |std::swap()|.
10 #include <utility> 10 #include <utility>
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 DCHECK(router_); 280 DCHECK(router_);
281 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE); 281 return router_->WaitForIncomingMessage(MOJO_DEADLINE_INDEFINITE);
282 } 282 }
283 283
284 // After this method is called, the object is in an invalid state and 284 // After this method is called, the object is in an invalid state and
285 // shouldn't be reused. 285 // shouldn't be reused.
286 InterfacePtrInfo<GenericInterface> PassInterface() { 286 InterfacePtrInfo<GenericInterface> PassInterface() {
287 endpoint_client_.reset(); 287 endpoint_client_.reset();
288 proxy_.reset(); 288 proxy_.reset();
289 return InterfacePtrInfo<GenericInterface>( 289 return InterfacePtrInfo<GenericInterface>(
290 router_ ? router_->PassMessagePipe() : handle_.Pass(), version_); 290 router_ ? router_->PassMessagePipe() : std::move(handle_), version_);
291 } 291 }
292 292
293 bool is_bound() const { return handle_.is_valid() || endpoint_client_; } 293 bool is_bound() const { return handle_.is_valid() || endpoint_client_; }
294 294
295 bool encountered_error() const { 295 bool encountered_error() const {
296 return endpoint_client_ ? endpoint_client_->encountered_error() : false; 296 return endpoint_client_ ? endpoint_client_->encountered_error() : false;
297 } 297 }
298 298
299 void set_connection_error_handler(const Closure& error_handler) { 299 void set_connection_error_handler(const Closure& error_handler) {
300 ConfigureProxyIfNecessary(); 300 ConfigureProxyIfNecessary();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 357
358 uint32_t version_; 358 uint32_t version_;
359 359
360 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); 360 DISALLOW_COPY_AND_ASSIGN(InterfacePtrState);
361 }; 361 };
362 362
363 } // namespace internal 363 } // namespace internal
364 } // namespace mojo 364 } // namespace mojo
365 365
366 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_ 366 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_STATE_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/array_serialization.h ('k') | mojo/public/cpp/system/macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698