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

Unified Diff: trunk/src/ipc/ipc_channel_proxy.cc

Issue 312553004: Revert 274310 "Introduce IPC::ChannelProxy::Create*() and IPC::S..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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 | « trunk/src/ipc/ipc_channel_proxy.h ('k') | trunk/src/ipc/ipc_sync_channel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ipc/ipc_channel_proxy.cc
===================================================================
--- trunk/src/ipc/ipc_channel_proxy.cc (revision 274314)
+++ trunk/src/ipc/ipc_channel_proxy.cc (working copy)
@@ -304,69 +304,20 @@
//-----------------------------------------------------------------------------
-// static
-scoped_ptr<ChannelProxy> ChannelProxy::Create(
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner) {
- return make_scoped_ptr(new ChannelProxy(
- listener, ipc_task_runner));
+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::CreateClient(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner) {
- scoped_ptr<ChannelProxy> channel = Create(
- listener, ipc_task_runner);
- channel->InitClient(channel_handle, true);
- return channel.Pass();
-}
-
-// static
-scoped_ptr<ChannelProxy> ChannelProxy::CreateServer(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner) {
- scoped_ptr<ChannelProxy> channel = Create(
- listener, ipc_task_runner);
- channel->InitServer(channel_handle, true);
- return channel.Pass();
-}
-
-// static
-scoped_ptr<ChannelProxy> ChannelProxy::CreateNamedClient(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner) {
- scoped_ptr<ChannelProxy> channel = Create(
- listener, ipc_task_runner);
- channel->InitNamedClient(channel_handle, true);
- return channel.Pass();
-}
-
-// static
-scoped_ptr<ChannelProxy> ChannelProxy::CreateNamedServer(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner) {
- scoped_ptr<ChannelProxy> channel = Create(
- listener, ipc_task_runner);
- channel->InitNamedServer(channel_handle, true);
- return channel.Pass();
-}
-
ChannelProxy::ChannelProxy(Context* context)
: 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());
@@ -373,10 +324,9 @@
Close();
}
-void ChannelProxy::InitByMode(
- const IPC::ChannelHandle& channel_handle,
- Channel::Mode mode,
- bool create_pipe_now) {
+void ChannelProxy::Init(const IPC::ChannelHandle& channel_handle,
+ Channel::Mode mode,
+ bool create_pipe_now) {
DCHECK(CalledOnValidThread());
DCHECK(!did_init_);
#if defined(OS_POSIX)
@@ -408,26 +358,6 @@
did_init_ = true;
}
-void ChannelProxy::InitClient(const IPC::ChannelHandle& channel_handle,
- bool create_pipe_now) {
- InitByMode(channel_handle, Channel::MODE_CLIENT, create_pipe_now);
-}
-
-void ChannelProxy::InitServer(const IPC::ChannelHandle& channel_handle,
- bool create_pipe_now) {
- InitByMode(channel_handle, Channel::MODE_SERVER, create_pipe_now);
-}
-
-void ChannelProxy::InitNamedClient(const IPC::ChannelHandle& channel_handle,
- bool create_pipe_now) {
- InitByMode(channel_handle, Channel::MODE_NAMED_CLIENT, create_pipe_now);
-}
-
-void ChannelProxy::InitNamedServer(const IPC::ChannelHandle& channel_handle,
- bool create_pipe_now) {
- InitByMode(channel_handle, Channel::MODE_NAMED_SERVER, create_pipe_now);
-}
-
void ChannelProxy::Close() {
DCHECK(CalledOnValidThread());
« no previous file with comments | « trunk/src/ipc/ipc_channel_proxy.h ('k') | trunk/src/ipc/ipc_sync_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698