IPC::ChannelMojo: Introduce IPC::MojoBootstrap for Windows
commit54f6f80c3623a6fb9d3049b6f5e0e23b1d76c34d
authormorrita <morrita@chromium.org>
Tue, 23 Sep 2014 21:16:00 +0000 (23 14:16 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 23 Sep 2014 21:16:28 +0000 (23 21:16 +0000)
treed5188994206cd43ae680f6e7325ec5c45075b9da
parentde9555146d87d2daf5e2e1da425d46b8efc06415
IPC::ChannelMojo: Introduce IPC::MojoBootstrap for Windows

ChannelMojo doesn't work on Windows with existing implementaion
and this CL fixes it.

On Windows, ChannelHandle isn't immediately usable: The handle has
to be activated through ConnectNamedPipe() windows API, which is done in
its own Connect() handlshaking phase. ChannelMojo didn't Connect()
underlying channel and took the ChannelHandle over so the handle
wasn't activated.

Instead of hijacking underlying ChannelHandle, this CL actually Connect()s
underlying channel, creates a pipe on the server side, send one side of the
pipe to the client process, and use the pipe for the MessagePipe
initialization.

These initialization task is encapsulated behind new MojoBootstrap class.
ChannelMojo creates MojoBootstrap class to get the PlatformHandle which
is already activated and usable.

BUG=377980
TEST=ipc_mojo_bootstrap_unittest.cc, ipc_channel_mojo_unittest.cc
R=viettrungluu@chromium.org, darin@chromium.org, yzshen@chromium.org

Review URL: https://codereview.chromium.org/553283002

Cr-Commit-Position: refs/heads/master@{#296248}
16 files changed:
content/browser/renderer_host/render_process_host_impl.cc
content/browser/renderer_host/render_process_host_impl.h
content/child/child_thread.cc
ipc/ipc_test_base.cc
ipc/ipc_test_base.h
ipc/mojo/BUILD.gn
ipc/mojo/ipc_channel_mojo.cc
ipc/mojo/ipc_channel_mojo.h
ipc/mojo/ipc_channel_mojo_host.cc [new file with mode: 0644]
ipc/mojo/ipc_channel_mojo_host.h [new file with mode: 0644]
ipc/mojo/ipc_channel_mojo_unittest.cc
ipc/mojo/ipc_mojo.gyp
ipc/mojo/ipc_mojo_bootstrap.cc [new file with mode: 0644]
ipc/mojo/ipc_mojo_bootstrap.h [new file with mode: 0644]
ipc/mojo/ipc_mojo_bootstrap_unittest.cc [new file with mode: 0644]
ipc/mojo/ipc_mojo_perftest.cc