From e482111a87c5415af8aaf33636f00c650c19b61e Mon Sep 17 00:00:00 2001 From: "morrita@chromium.org" Date: Fri, 30 May 2014 03:58:59 +0000 Subject: 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 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 --- cloud_print/service/win/service_listener.cc | 4 ++-- cloud_print/service/win/setup_listener.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'cloud_print/service') diff --git a/cloud_print/service/win/service_listener.cc b/cloud_print/service/win/service_listener.cc index 53622a8..bdb2217 100644 --- a/cloud_print/service/win/service_listener.cc +++ b/cloud_print/service/win/service_listener.cc @@ -91,8 +91,8 @@ void ServiceListener::Connect() { SECURITY_SQOS_PRESENT | SECURITY_IDENTIFICATION | FILE_FLAG_OVERLAPPED, NULL)); if (handle.IsValid()) { - channel_.reset(new IPC::Channel(IPC::ChannelHandle(handle), - IPC::Channel::MODE_CLIENT, this)); + channel_ = IPC::Channel::CreateClient(IPC::ChannelHandle(handle), + this); channel_->Connect(); } else { ipc_thread_->message_loop()->PostDelayedTask( diff --git a/cloud_print/service/win/setup_listener.cc b/cloud_print/service/win/setup_listener.cc index dd1cb37..c0b6d1b 100644 --- a/cloud_print/service/win/setup_listener.cc +++ b/cloud_print/service/win/setup_listener.cc @@ -117,8 +117,8 @@ void SetupListener::Connect(const base::string16& user) { IPC::Channel::kReadBufferSize, IPC::Channel::kReadBufferSize, 5000, &attribs)); if (pipe.IsValid()) { - channel_.reset(new IPC::Channel(IPC::ChannelHandle(pipe), - IPC::Channel::MODE_SERVER, this)); + channel_ = IPC::Channel::CreateServer(IPC::ChannelHandle(pipe), + this); channel_->Connect(); } } -- cgit v1.1