Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1746)

Unified Diff: ipc/ipc_channel_factory.cc

Issue 2159293002: Plumb explicit IPC task runner through to IPC::Channel creation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add dcheck Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_channel_mojo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_factory.cc
diff --git a/ipc/ipc_channel_factory.cc b/ipc/ipc_channel_factory.cc
index dbb24c087e0cdf6cfe16b4a438bf14dd7175b690..8fb4d772e0072c8186cc6635bda73593af4c0d74 100644
--- a/ipc/ipc_channel_factory.cc
+++ b/ipc/ipc_channel_factory.cc
@@ -13,8 +13,11 @@ namespace {
class PlatformChannelFactory : public ChannelFactory {
public:
- PlatformChannelFactory(ChannelHandle handle, Channel::Mode mode)
- : handle_(handle), mode_(mode) {}
+ PlatformChannelFactory(
+ ChannelHandle handle,
+ Channel::Mode mode,
+ const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner)
+ : handle_(handle), mode_(mode), ipc_task_runner_(ipc_task_runner) {}
std::string GetName() const override {
return handle_.name;
@@ -23,14 +26,20 @@ class PlatformChannelFactory : public ChannelFactory {
std::unique_ptr<Channel> BuildChannel(Listener* listener) override {
if (handle_.mojo_handle.is_valid()) {
return ChannelMojo::Create(
- mojo::ScopedMessagePipeHandle(handle_.mojo_handle), mode_, listener);
+ mojo::ScopedMessagePipeHandle(handle_.mojo_handle), mode_, listener,
+ ipc_task_runner_);
}
return Channel::Create(handle_, mode_, listener);
}
+ scoped_refptr<base::SingleThreadTaskRunner> GetIPCTaskRunner() override {
+ return ipc_task_runner_;
+ }
+
private:
ChannelHandle handle_;
Channel::Mode mode_;
+ scoped_refptr<base::SingleThreadTaskRunner> ipc_task_runner_;
DISALLOW_COPY_AND_ASSIGN(PlatformChannelFactory);
};
@@ -40,8 +49,10 @@ class PlatformChannelFactory : public ChannelFactory {
// static
std::unique_ptr<ChannelFactory> ChannelFactory::Create(
const ChannelHandle& handle,
- Channel::Mode mode) {
- return base::WrapUnique(new PlatformChannelFactory(handle, mode));
+ Channel::Mode mode,
+ const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
+ return base::WrapUnique(
+ new PlatformChannelFactory(handle, mode, ipc_task_runner));
}
} // namespace IPC
« no previous file with comments | « ipc/ipc_channel_factory.h ('k') | ipc/ipc_channel_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698