diff options
author | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 20:30:17 +0000 |
---|---|---|
committer | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-29 20:30:17 +0000 |
commit | 3909aa922a9e3c966de47ba2dde76c3a11596b43 (patch) | |
tree | e31523ae6de47f6e5ba253760e931829d619e8cc /chrome/utility | |
parent | 7deb50808af310b10d9eb25ae81aefff8a3c652f (diff) | |
download | chromium_src-3909aa922a9e3c966de47ba2dde76c3a11596b43.zip chromium_src-3909aa922a9e3c966de47ba2dde76c3a11596b43.tar.gz chromium_src-3909aa922a9e3c966de47ba2dde76c3a11596b43.tar.bz2 |
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
R=darin@chromium.org,cpu@chromium.org
Review URL: https://codereview.chromium.org/307653003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/utility')
-rw-r--r-- | chrome/utility/importer/firefox_importer_unittest_utils_mac.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc index 5c385de..9608f63 100644 --- a/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/utility/importer/firefox_importer_unittest_utils_mac.cc @@ -130,9 +130,7 @@ bool FFUnitTestDecryptorProxy::Setup(const base::FilePath& nss_path) { message_loop_.reset(new base::MessageLoopForIO()); listener_.reset(new FFDecryptorServerChannelListener()); - channel_.reset(new IPC::Channel(kTestChannelID, - IPC::Channel::MODE_SERVER, - listener_.get())); + channel_ = IPC::Channel::CreateServer(kTestChannelID, listener_.get()); CHECK(channel_->Connect()); listener_->SetSender(channel_.get()); @@ -264,9 +262,10 @@ MULTIPROCESS_IPC_TEST_MAIN(NSSDecrypterChildProcess) { base::MessageLoopForIO main_message_loop; FFDecryptorClientChannelListener listener; - IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); - CHECK(channel.Connect()); - listener.SetSender(&channel); + scoped_ptr<IPC::Channel> channel = IPC::Channel::CreateClient( + kTestChannelID, &listener); + CHECK(channel->Connect()); + listener.SetSender(channel.get()); // run message loop base::MessageLoop::current()->Run(); |