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

Issue 8890060: Revert 113722 - Add Pass(), which implements move semantics, to scoped_ptr, scoped_array, and sco... (Closed)

Created:
9 years ago by Sergey Ulanov
Modified:
9 years ago
Reviewers:
awong
CC:
chromium-reviews, brettw-cc_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

Revert 113722 - Add Pass(), which implements move semantics, to scoped_ptr, scoped_array, and scoped_ptr_malloc. This modification to the scopers implements the "moveable but not copyable" semantics that were introduced in C++11's unique_ptr<>. With this, is now possible to use scopers as an argument type or a return type. This signifies, in the type system, transfer of ownership into a function or out of a function respectively. Calling, or returning such a function MUST use the temporary resulting from the scoper's Pass() function. You CANNOT just pass the scoper by copy as there is still no copy constructor or assignment operator; trying to do so will yield a compilation error. This distinction makes it possible to avoid the implicit ownership transfer issues of auto_ptr, but still allow us to have compiler enforced ownership transfer. Also adds a Passed() helper that allows using a scoper with Bind(). BUG=96118 TEST=new unittests Review URL: http://codereview.chromium.org/8774032 TBR=ajwong@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=113738

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+163 lines, -640 lines) Patch
M base/bind_helpers.h View 8 chunks +31 lines, -121 lines 0 comments Download
M base/bind_internal.h View 78 chunks +78 lines, -189 lines 0 comments Download
M base/bind_internal.h.pump View 8 chunks +8 lines, -7 lines 0 comments Download
M base/bind_unittest.cc View 5 chunks +5 lines, -62 lines 0 comments Download
M base/callback.h View 7 chunks +28 lines, -28 lines 0 comments Download
M base/callback.h.pump View 1 chunk +1 line, -1 line 0 comments Download
M base/callback_internal.h View 2 chunks +0 lines, -59 lines 0 comments Download
M base/memory/scoped_ptr.h View 10 chunks +12 lines, -81 lines 0 comments Download
M base/memory/scoped_ptr_unittest.cc View 2 chunks +0 lines, -92 lines 0 comments Download

Messages

Total messages: 1 (0 generated)
Sergey Ulanov
9 years ago (2011-12-09 02:25:20 UTC) #1

          

Powered by Google App Engine
This is Rietveld 408576698