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

Unified Diff: ipc/mojo/ipc_channel_mojo_unittest.cc

Issue 1069943003: Revert of ChannelMojo: Ensure that it always has ScopedIPCSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/mojo/ipc_channel_mojo_host.cc ('k') | ipc/mojo/ipc_mojo_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/mojo/ipc_channel_mojo_unittest.cc
diff --git a/ipc/mojo/ipc_channel_mojo_unittest.cc b/ipc/mojo/ipc_channel_mojo_unittest.cc
index bf70b7f6f8a631e8e8ed0156bf33311ee6fc332e..356d3b3acd110ab1835f89ca9849cd0ccdc8c4fa 100644
--- a/ipc/mojo/ipc_channel_mojo_unittest.cc
+++ b/ipc/mojo/ipc_channel_mojo_unittest.cc
@@ -66,9 +66,12 @@
class ChannelClient {
public:
explicit ChannelClient(IPC::Listener* listener, const char* name) {
- channel_ = IPC::ChannelMojo::Create(NULL, main_message_loop_.task_runner(),
+ ipc_support_.reset(
+ new IPC::ScopedIPCSupport(main_message_loop_.task_runner()));
+ channel_ = IPC::ChannelMojo::Create(NULL,
IPCTestBase::GetChannelName(name),
- IPC::Channel::MODE_CLIENT, listener);
+ IPC::Channel::MODE_CLIENT,
+ listener);
}
void Connect() {
@@ -87,6 +90,7 @@
private:
base::MessageLoopForIO main_message_loop_;
+ scoped_ptr<IPC::ScopedIPCSupport> ipc_support_;
scoped_ptr<IPC::ChannelMojo> channel_;
};
@@ -94,17 +98,22 @@
public:
void InitWithMojo(const std::string& test_client_name) {
Init(test_client_name);
+ ipc_support_.reset(new IPC::ScopedIPCSupport(task_runner()));
}
void TearDown() override {
// Make sure Mojo IPC support is properly shutdown on the I/O loop before
// TearDown continues.
+ ipc_support_.reset();
base::RunLoop run_loop;
task_runner()->PostTask(FROM_HERE, run_loop.QuitClosure());
run_loop.Run();
IPCTestBase::TearDown();
}
+
+ private:
+ scoped_ptr<IPC::ScopedIPCSupport> ipc_support_;
};
class IPCChannelMojoTest : public IPCChannelMojoTestBase {
@@ -114,7 +123,7 @@
base::SequencedTaskRunner* runner) override {
host_.reset(new IPC::ChannelMojoHost(task_runner()));
return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(),
- task_runner(), handle);
+ handle);
}
bool DidStartClient() override {
@@ -222,7 +231,7 @@
base::SequencedTaskRunner* runner) override {
host_.reset(new IPC::ChannelMojoHost(task_runner()));
return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(),
- task_runner(), handle);
+ handle);
}
bool DidStartClient() override {
@@ -556,7 +565,7 @@
base::SequencedTaskRunner* runner) override {
host_.reset(new IPC::ChannelMojoHost(task_runner()));
return IPC::ChannelMojo::CreateServerFactory(host_->channel_delegate(),
- task_runner(), handle);
+ handle);
}
virtual bool DidStartClient() override {
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_host.cc ('k') | ipc/mojo/ipc_mojo_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698