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

Issue 9021032: Redo r113722 - Add Pass(), which implements move semantics, to scoped_ptr, scoped_array.... (Closed)

Created:
9 years ago by awong
Modified:
9 years ago
Reviewers:
CC:
chromium-reviews, jstritar+watch_chromium.org, penghuang+watch_chromium.org, yusukes+watch_chromium.org, brettw-cc_chromium.org, jam, mihaip+watch_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, Aaron Boodman, darin-cc_chromium.org, Paweł Hajdan Jr., James Su
Visibility:
Public.

Description

Redo r113722 - Add Pass(), which implements move semantics, to scoped_ptr, scoped_array.... (This undoes the revert in r114247. Win canaries still can't link, but this change has been deemed safe). 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 a function or explicit cast. 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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=115441

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+657 lines, -168 lines) Patch
M base/bind_helpers.h View 8 chunks +121 lines, -31 lines 0 comments Download
M base/bind_internal.h View 78 chunks +189 lines, -78 lines 0 comments Download
M base/bind_internal.h.pump View 8 chunks +7 lines, -8 lines 0 comments Download
M base/bind_unittest.cc View 5 chunks +62 lines, -5 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 +59 lines, -0 lines 0 comments Download
M base/memory/scoped_ptr.h View 10 chunks +81 lines, -12 lines 0 comments Download
M base/memory/scoped_ptr_unittest.cc View 2 chunks +92 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_manifests_unittest.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_widget_host_view_win.cc View 2 chunks +4 lines, -5 lines 0 comments Download

Powered by Google App Engine
This is Rietveld 408576698