Plumb explicit IPC task runner through to IPC::Channel creation
In preparation for a follow-up CL, IPC::ChannelMojo needs to
know which TaskRunner it will be used from despite being constructed
on some arbitray other thread (for e.g. ChannelProxy).
This CL plumbs through an IPC TaskRunner to various Channel
instantiation sites to avoid lots of noise in the other CL.
There are no behavioral changes introduced here.
BUG=612500,619202
Review-Url: https://codereview.chromium.org/2159293002
Cr-Commit-Position: refs/heads/master@{#406486}
diff --git a/ipc/ipc_channel_common.cc b/ipc/ipc_channel_common.cc
index e85aa61a2..e3f6558d 100644
--- a/ipc/ipc_channel_common.cc
+++ b/ipc/ipc_channel_common.cc
@@ -12,11 +12,12 @@
// static
std::unique_ptr<Channel> Channel::CreateClient(
const IPC::ChannelHandle& channel_handle,
- Listener* listener) {
+ Listener* listener,
+ const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
if (channel_handle.mojo_handle.is_valid()) {
return ChannelMojo::Create(
mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
- Channel::MODE_CLIENT, listener);
+ Channel::MODE_CLIENT, listener, ipc_task_runner);
}
return Channel::Create(channel_handle, Channel::MODE_CLIENT, listener);
}
@@ -38,11 +39,12 @@
// static
std::unique_ptr<Channel> Channel::CreateServer(
const IPC::ChannelHandle& channel_handle,
- Listener* listener) {
+ Listener* listener,
+ const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
if (channel_handle.mojo_handle.is_valid()) {
return ChannelMojo::Create(
mojo::ScopedMessagePipeHandle(channel_handle.mojo_handle),
- Channel::MODE_SERVER, listener);
+ Channel::MODE_SERVER, listener, ipc_task_runner);
}
return Channel::Create(channel_handle, Channel::MODE_SERVER, listener);
}