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

Unified Diff: ipc/ipc_test_base.cc

Issue 536213002: Add ipc_mojo_perftests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed garbage Created 6 years, 3 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_test_base.h ('k') | ipc/mojo/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_test_base.cc
diff --git a/ipc/ipc_test_base.cc b/ipc/ipc_test_base.cc
index 80ddd2da2ea6c2842236a85a12392086086c0eea..6abef0f1470b47b721dbf16ad7de8a188e9d2204 100644
--- a/ipc/ipc_test_base.cc
+++ b/ipc/ipc_test_base.cc
@@ -52,8 +52,8 @@ void IPCTestBase::InitWithCustomMessageLoop(
}
void IPCTestBase::CreateChannel(IPC::Listener* listener) {
- return CreateChannelFromChannelHandle(GetChannelName(test_client_name_),
- listener);
+ CreateChannelFromChannelHandle(
+ GetChannelName(test_client_name_), listener);
}
bool IPCTestBase::ConnectChannel() {
@@ -80,7 +80,8 @@ void IPCTestBase::CreateChannelFromChannelHandle(
IPC::Listener* listener) {
CHECK(!channel_.get());
CHECK(!channel_proxy_.get());
- channel_ = IPC::Channel::CreateServer(channel_handle, listener);
+ channel_ = CreateChannelFactory(
+ channel_handle, task_runner().get())->BuildChannel(listener);
}
void IPCTestBase::CreateChannelProxy(
@@ -88,10 +89,11 @@ void IPCTestBase::CreateChannelProxy(
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) {
CHECK(!channel_.get());
CHECK(!channel_proxy_.get());
- channel_proxy_ = IPC::ChannelProxy::Create(GetChannelName(test_client_name_),
- IPC::Channel::MODE_SERVER,
- listener,
- ipc_task_runner);
+ channel_proxy_ = IPC::ChannelProxy::Create(
+ CreateChannelFactory(GetChannelName(test_client_name_),
+ ipc_task_runner.get()),
+ listener,
+ ipc_task_runner);
}
void IPCTestBase::DestroyChannelProxy() {
@@ -135,3 +137,9 @@ bool IPCTestBase::WaitForClientShutdown() {
scoped_refptr<base::TaskRunner> IPCTestBase::task_runner() {
return message_loop_->message_loop_proxy();
}
+
+scoped_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory(
+ const IPC::ChannelHandle& handle,
+ base::TaskRunner* runner) {
+ return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER);
+}
« no previous file with comments | « ipc/ipc_test_base.h ('k') | ipc/mojo/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698