Fix MojoDuplicateBufferHandle failure behavior

If handle duplication fails due to handle exhaustion we would
incorrectly close the source handle's dispatcher rather than
the newly allocated dispatcher. That's no good, and this does the
right thing instead.

In practice it's unlikely that an instance of Chrome has ever
actually run out of Mojo handles (and many other things would
break as a result in that case anyway), so this is merely fixing
a hypothetical bug.

Bug: 776293
Change-Id: I4872d10b7261721d6f99836ec95c80d4ed385d77
Reviewed-on: https://chromium-review.googlesource.com/733851
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510876}

CrOS-Libchrome-Original-Commit: 027bc13a7481ee005d535e7fcd433990a0924343
1 file changed
tree: 1003dc48eb7016744f18ccef28a29763d25b06ae
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/