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

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 310853003: Add IPC::ChannelProxy::Create() and IPC::SyncChannel::Create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 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_channel_proxy.h ('k') | ipc/ipc_sync_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.cc
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index e88bb5d0e72abd0e508fb4b1c1fc96833e6d9699..ceffb9474c47290cc11c4590cf1f680d8bc70fa6 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -304,13 +304,15 @@ void ChannelProxy::Context::OnDispatchBadMessage(const Message& message) {
//-----------------------------------------------------------------------------
-ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,
- Channel::Mode mode,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner)
- : context_(new Context(listener, ipc_task_runner)),
- did_init_(false) {
- Init(channel_handle, mode, true);
+// static
+scoped_ptr<ChannelProxy> ChannelProxy::Create(
+ const IPC::ChannelHandle& channel_handle,
+ Channel::Mode mode,
+ Listener* listener,
+ base::SingleThreadTaskRunner* ipc_task_runner) {
+ scoped_ptr<ChannelProxy> channel(new ChannelProxy(listener, ipc_task_runner));
+ channel->Init(channel_handle, mode, true);
+ return channel.Pass();
}
ChannelProxy::ChannelProxy(Context* context)
@@ -318,6 +320,11 @@ ChannelProxy::ChannelProxy(Context* context)
did_init_(false) {
}
+ChannelProxy::ChannelProxy(Listener* listener,
+ base::SingleThreadTaskRunner* ipc_task_runner)
+ : context_(new Context(listener, ipc_task_runner)), did_init_(false) {
+}
+
ChannelProxy::~ChannelProxy() {
DCHECK(CalledOnValidThread());
« no previous file with comments | « ipc/ipc_channel_proxy.h ('k') | ipc/ipc_sync_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698