ChannelMojo: Handle when ChannelMojo outlives ChannelMojoHost
In some case ChannelMojo outlives ChannelMojoHost because
two objects are living in diffent thread.
Instead of using lifecycle callbacks, this CL relies on
WeakPtr. See comment on ipc_channel_mojo_host.h for
more details.
This CL also fixes a crash on --single-process mode.
R=viettrungluu@chromium.org
TBR=jam@chromium.org
TEST=content_browsertests (with --enable-renderer-mojo-channel on)
BUG=377980
Review URL: https://codereview.chromium.org/599333002
Cr-Commit-Position: refs/heads/master@{#296871}
CrOS-Libchrome-Original-Commit: e9453ea69cbb3d52e67394e75c747b0b2d970621
6 files changed