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

Unified Diff: mojo/common/weak_binding_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/data_pipe_utils.cc ('k') | mojo/common/weak_interface_ptr_set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/weak_binding_set.h
diff --git a/mojo/common/weak_binding_set.h b/mojo/common/weak_binding_set.h
index c3736ff901787f2879dfe1696f7559b080ee1f39..d324224f3029cb264a18cf94d4282cd58cd58bb4 100644
--- a/mojo/common/weak_binding_set.h
+++ b/mojo/common/weak_binding_set.h
@@ -6,6 +6,7 @@
#define MOJO_COMMON_WEAK_BINDING_SET_H_
#include <algorithm>
+#include <utility>
#include <vector>
#include "base/memory/weak_ptr.h"
@@ -32,7 +33,7 @@ class WeakBindingSet {
void AddBinding(Interface* impl,
InterfaceRequest<GenericInterface> request) {
- auto binding = new WeakBinding<Interface>(impl, request.Pass());
+ auto binding = new WeakBinding<Interface>(impl, std::move(request));
binding->set_connection_error_handler([this]() { OnConnectionError(); });
bindings_.push_back(binding->GetWeakPtr());
}
@@ -74,8 +75,7 @@ class WeakBinding {
using GenericInterface = typename Interface::GenericInterface;
WeakBinding(Interface* impl, InterfaceRequest<GenericInterface> request)
- : binding_(impl, request.Pass()),
- weak_ptr_factory_(this) {
+ : binding_(impl, std::move(request)), weak_ptr_factory_(this) {
binding_.set_connection_error_handler([this]() { OnConnectionError(); });
}
« no previous file with comments | « mojo/common/data_pipe_utils.cc ('k') | mojo/common/weak_interface_ptr_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698