Introduce IPC::Channel::Create*() to ensure it being heap-allocated.
This change introduces IPC::Channel::Create*() API to turn
IPC::Channel into a heap allocated object. This will allow us to
make Channel a polymorphic class.
This change also tries to hide Channel::Mode from public API
so that we can simplify channel creation code paths cleaner in
following changes. ChannelProxy has to follow same pattern to
finish this cleanup. Such changes will follow.
TEST=none
BUG=377980
[email protected],[email protected]
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273575
Review URL: https://codereview.chromium.org/307653003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273713 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc
index 28886071..5527abc 100644
--- a/ipc/sync_socket_unittest.cc
+++ b/ipc/sync_socket_unittest.cc
@@ -108,11 +108,11 @@
MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SyncSocketServerClient) {
base::MessageLoopForIO main_message_loop;
SyncSocketServerListener listener;
- IPC::Channel channel(IPCTestBase::GetChannelName("SyncSocketServerClient"),
- IPC::Channel::MODE_CLIENT,
- &listener);
- EXPECT_TRUE(channel.Connect());
- listener.Init(&channel);
+ scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient(
+ IPCTestBase::GetChannelName("SyncSocketServerClient"),
+ &listener));
+ EXPECT_TRUE(channel->Connect());
+ listener.Init(channel.get());
base::MessageLoop::current()->Run();
return 0;
}