base: Fix DCHECK when thread creation fails

When thread creation fails[1], base::Thread tries to delete an unbound
MessageLoop on the originating thread. If that thread already has a
MessageLoop, this trips a DCHECK in MessageLoop's destructor that checks
against having two MessageLoops on the same thread.

This patch adjusts the DCHECK logic to ignore destroying unbound message
loops on a thread that already has a separate message loop (which it was
already trying to do according to the comments).

[1] https://code.google.com/p/chromium/codesearch#chromium/src/base/threading/thread.cc&l=116

BUG=480100

Review URL: https://codereview.chromium.org/1559353002

Cr-Commit-Position: refs/heads/master@{#368057}


CrOS-Libchrome-Original-Commit: 3ae7dab6fb40b0fe1d5c18eda603a89a455394fd
3 files changed
tree: 7db0689e0584788f67e006122d5ad4866f9eb0c3
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/