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

Review URL: http://codereview.chromium.org/9021032

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115441 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 014d0f6be0c06b1cf87854fae5397e18c3523ada
9 files changed
tree: 139856b571f7982bf9e0c5dafcb00ea851c123de
  1. base/
  2. build/
  3. dbus/
  4. ipc/
  5. testing/
  6. third_party/