Update scoped_ptr<T>::reset() to more closely match std::unique_ptr<T>.
Remove the no-op behavior of a scoped_ptr "self-reset", and update the
reset() method to detect problematic dependencies on the sequence of
events. Eventually, reset() will be updated to exactly match the
implementation of std::unique_ptr<T> by setting data_.ptr to the new
value before deleting the old value.
However, this will expose latent bugs where a destructor invoked
transitively by reset() attempts to dereference the same scoped_ptr.
Relying on the value of get() in this instance will dispatch calls to
the incorrect object. As a temporary measure to detect this class of
bugs, set data_.ptr to NULL during deletion so that it results in a
crash.
BUG=162971,176091
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=184179
Review URL: https://codereview.chromium.org/
12223113
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185551 0039d316-1c4b-4281-b951-d872f2087c98