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

Unified Diff: mojo/common/weak_interface_ptr_set.h

Issue 1538823002: Convert Pass()→std::move() in mojo/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « mojo/common/weak_binding_set.h ('k') | mojo/converters/blink/blink_input_events_type_converters.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/weak_interface_ptr_set.h
diff --git a/mojo/common/weak_interface_ptr_set.h b/mojo/common/weak_interface_ptr_set.h
index e423b932296bfc212e9e35b9e1b84e041d55cac5..3a73640b3602804c24cb613cd2ea7c4d21d14cf0 100644
--- a/mojo/common/weak_interface_ptr_set.h
+++ b/mojo/common/weak_interface_ptr_set.h
@@ -5,6 +5,7 @@
#ifndef MOJO_COMMON_WEAK_INTERFACE_PTR_SET_H_
#define MOJO_COMMON_WEAK_INTERFACE_PTR_SET_H_
+#include <utility>
#include <vector>
#include "base/memory/weak_ptr.h"
@@ -22,7 +23,7 @@ class WeakInterfacePtrSet {
~WeakInterfacePtrSet() { CloseAll(); }
void AddInterfacePtr(InterfacePtr<Interface> ptr) {
- auto weak_interface_ptr = new WeakInterfacePtr<Interface>(ptr.Pass());
+ auto weak_interface_ptr = new WeakInterfacePtr<Interface>(std::move(ptr));
ptrs_.push_back(weak_interface_ptr->GetWeakPtr());
ClearNullInterfacePtrs();
}
@@ -60,7 +61,7 @@ template <typename Interface>
class WeakInterfacePtr {
public:
explicit WeakInterfacePtr(InterfacePtr<Interface> ptr)
- : ptr_(ptr.Pass()), weak_ptr_factory_(this) {
+ : ptr_(std::move(ptr)), weak_ptr_factory_(this) {
ptr_.set_connection_error_handler([this]() { delete this; });
}
~WeakInterfacePtr() {}
« no previous file with comments | « mojo/common/weak_binding_set.h ('k') | mojo/converters/blink/blink_input_events_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698