Assert sequence validity on non-thread-safe RefCount manipulations

This CL adds DCHECKs to non-thread-safe base::RefCount to trace racy
ref count manipulations. A ref counted object is considered to be bound
to a sequence if the count is more than one. After this CL, ref count
manipulations to a sequenced-bound one cause DCHECK failure.

This CL also adds ScopedAllowCrossThreadRefCountAccess to opt out,
and applies the opt-out as needed.

BUG=688072
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel

Review-Url: https://codereview.chromium.org/2666423002
Cr-Original-Commit-Position: refs/heads/master@{#460773}
Committed: https://chromium.googlesource.com/chromium/src/+/f9a212dec0fec22e21d7f66ad1aa9414ed1dc068
Review-Url: https://codereview.chromium.org/2666423002
Cr-Commit-Position: refs/heads/master@{#461235}


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