IPC: Fix attachment brokering race condition.
A channel must be registered as a broker communication channel before it is
connected. When possible, invert the sequence of the call to connect a channel,
and the call to register the channel as a broker. In some cases, the channel
constructor and the channel initializer had to be separated, so that the
registration could happen in between.
This requirement is now enforced by a CHECK, which verifies that a channel
cannot be registered after it is connected.
BUG=598088
Review URL: https://codereview.chromium.org/1903663004
Cr-Commit-Position: refs/heads/master@{#389618}
CrOS-Libchrome-Original-Commit: 9097190cafdecfb1b5796b65c83af92e861ccaf8
8 files changed