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

Unified Diff: mojo/public/cpp/bindings/interface_ptr_info.h

Issue 1535943002: Convert Pass()→std::move() in //mojo/public/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove self-move checks to avoid triggering clang warning. Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/interface_ptr_info.h
diff --git a/mojo/public/cpp/bindings/interface_ptr_info.h b/mojo/public/cpp/bindings/interface_ptr_info.h
index 4f61915fb2a2528c77a723f81d01f0ba47384cac..dd102b11fde84fc3cc454b1dc8c2b36f800a67b7 100644
--- a/mojo/public/cpp/bindings/interface_ptr_info.h
+++ b/mojo/public/cpp/bindings/interface_ptr_info.h
@@ -5,6 +5,8 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_INFO_H_
#define MOJO_PUBLIC_CPP_BINDINGS_INTERFACE_PTR_INFO_H_
+#include <utility>
+
#include "mojo/public/cpp/system/macros.h"
#include "mojo/public/cpp/system/message_pipe.h"
@@ -20,10 +22,10 @@ class InterfacePtrInfo {
InterfacePtrInfo() : version_(0u) {}
InterfacePtrInfo(ScopedMessagePipeHandle handle, uint32_t version)
- : handle_(handle.Pass()), version_(version) {}
+ : handle_(std::move(handle)), version_(version) {}
InterfacePtrInfo(InterfacePtrInfo&& other)
- : handle_(other.handle_.Pass()), version_(other.version_) {
+ : handle_(std::move(other.handle_)), version_(other.version_) {
other.version_ = 0u;
}
@@ -41,9 +43,11 @@ class InterfacePtrInfo {
bool is_valid() const { return handle_.is_valid(); }
- ScopedMessagePipeHandle PassHandle() { return handle_.Pass(); }
+ ScopedMessagePipeHandle PassHandle() { return std::move(handle_); }
const ScopedMessagePipeHandle& handle() const { return handle_; }
- void set_handle(ScopedMessagePipeHandle handle) { handle_ = handle.Pass(); }
+ void set_handle(ScopedMessagePipeHandle handle) {
+ handle_ = std::move(handle);
+ }
uint32_t version() const { return version_; }
void set_version(uint32_t version) { version_ = version; }

Powered by Google App Engine
This is Rietveld 408576698