summaryrefslogtreecommitdiffstats
path: root/ipc/mojo/ipc_channel_mojo_unittest.cc
diff options
context:
space:
mode:
authormorrita <morrita@chromium.org>2014-09-25 20:20:48 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-26 03:20:58 +0000
commite9453ea69cbb3d52e67394e75c747b0b2d970621 (patch)
tree3178358ae6c053774fbf636668f1e34f11526f60 /ipc/mojo/ipc_channel_mojo_unittest.cc
parentba4cf8bb6dc77ea033fe13989eb604d6069daa97 (diff)
downloadchromium_src-e9453ea69cbb3d52e67394e75c747b0b2d970621.zip
chromium_src-e9453ea69cbb3d52e67394e75c747b0b2d970621.tar.gz
chromium_src-e9453ea69cbb3d52e67394e75c747b0b2d970621.tar.bz2
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}
Diffstat (limited to 'ipc/mojo/ipc_channel_mojo_unittest.cc')
-rw-r--r--ipc/mojo/ipc_channel_mojo_unittest.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc
index e1adecd..ac1efd1 100644
--- a/ipc/mojo/ipc_channel_mojo_unittest.cc
+++ b/ipc/mojo/ipc_channel_mojo_unittest.cc
@@ -83,7 +83,8 @@ class IPCChannelMojoTest : public IPCTestBase {
const IPC::ChannelHandle& handle,
base::TaskRunner* runner) OVERRIDE {
host_.reset(new IPC::ChannelMojoHost(task_runner()));
- return IPC::ChannelMojo::CreateServerFactory(host_.get(), handle);
+ return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(),
+ handle);
}
virtual bool DidStartClient() OVERRIDE {
@@ -190,7 +191,8 @@ class IPCChannelMojoErrorTest : public IPCTestBase {
const IPC::ChannelHandle& handle,
base::TaskRunner* runner) OVERRIDE {
host_.reset(new IPC::ChannelMojoHost(task_runner()));
- return IPC::ChannelMojo::CreateServerFactory(host_.get(), handle);
+ return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(),
+ handle);
}
virtual bool DidStartClient() OVERRIDE {