From e7ed5bad1cb58022345bd4768a4a070d43c98dad Mon Sep 17 00:00:00 2001 From: tzik Date: Tue, 5 Jul 2016 23:39:19 -0700 Subject: [PATCH] Make OwnedWrapper and PassedWrapper move-only base::internal::OwnedWrapper and base::internal::PassedWrapper have std::auto_ptr style destructive copy semantics, which is no longer needed. This CL makes them move-only for saner semantics. BUG=554299 Review-Url: https://codereview.chromium.org/2118173002 Cr-Commit-Position: refs/heads/master@{#403857} --- base/bind_helpers.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/bind_helpers.h b/base/bind_helpers.h index a7c2acc09c9703..93d02e37a997cc 100644 --- a/base/bind_helpers.h +++ b/base/bind_helpers.h @@ -225,7 +225,7 @@ class OwnedWrapper { explicit OwnedWrapper(T* o) : ptr_(o) {} ~OwnedWrapper() { delete ptr_; } T* get() const { return ptr_; } - OwnedWrapper(const OwnedWrapper& other) { + OwnedWrapper(OwnedWrapper&& other) { ptr_ = other.ptr_; other.ptr_ = NULL; } @@ -262,7 +262,7 @@ class PassedWrapper { public: explicit PassedWrapper(T&& scoper) : is_valid_(true), scoper_(std::move(scoper)) {} - PassedWrapper(const PassedWrapper& other) + PassedWrapper(PassedWrapper&& other) : is_valid_(other.is_valid_), scoper_(std::move(other.scoper_)) {} T Take() const { CHECK(is_valid_);