Skip to content

Commit

Permalink
Make OwnedWrapper and PassedWrapper move-only
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
tzik authored and Commit bot committed Jul 6, 2016
1 parent 439d35f commit e7ed5ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions base/bind_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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_);
Expand Down

0 comments on commit e7ed5ba

Please sign in to comment.