Allow custom deleters to opt out of self reset checks for scoped_ptr.
The self-reset check makes sense for the default deleters, because it
would otherwise leave a dangling pointer stored in the scoped_ptr.
However, a custom deleter might actually decrement a reference count
under the hood. This self-reset check can make assignment operators
implementation a lot uglier. One example is net's KeyPair: because
there might be a self-assignment, the original code needed to proxy
the incoming scoped_ptrs via a stack temporary before moving them
into their final location.
BUG=418347
Review URL: https://codereview.chromium.org/610533003
Cr-Commit-Position: refs/heads/master@{#299571}
CrOS-Libchrome-Original-Commit: 9961abd411eab6ec1cf9421078dfdaa001a7e2b5
2 files changed