Fix races with MessagePipeReader due to the Mojo IPC channel being thread-safe.
This change does three things:
1. Checks the threading of MessagePipeReader using a ThreadChecker.
2. Eliminates races on |pending_send_error_| by using atomic ops.
3. Documents and removes checks which are no longer valid because Send()
can be called on a non-IO thread.
BUG=522888,492867
TESTED=Enabled Mojo IPC channel and ran StatsTableBrowserTest.StartWithStatTable
with tsan 100 times.
Before: IPC-related races and DCHECK failures
After: No IPC-related races and DCHECK failures.
Review URL: https://codereview.chromium.org/1318453002
Cr-Commit-Position: refs/heads/master@{#346967}
CrOS-Libchrome-Original-Commit: 0b0e7480d9fd3816cbee891bf1618bc02b112cb4
2 files changed