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
tree: 30289fa7a5b54782070b0874dbec1b84fa40337d
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/