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
tree: 5abd0a78e4429d570a6c18d4d483b2a613865dd8
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/