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

Unified Diff: trunk/src/ipc/ipc_sync_channel.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_sync_channel.h ('k') | trunk/src/ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ipc/ipc_sync_channel.cc
===================================================================
--- trunk/src/ipc/ipc_sync_channel.cc (revision 274314)
+++ trunk/src/ipc/ipc_sync_channel.cc (working copy)
@@ -404,67 +404,21 @@
return base::Bind(&SyncChannel::SyncContext::OnWaitableEventSignaled, this);
}
-// static
-scoped_ptr<SyncChannel> SyncChannel::CreateClient(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner,
- bool create_pipe_now,
- base::WaitableEvent* shutdown_event) {
- scoped_ptr<SyncChannel> channel = Create(
- listener, ipc_task_runner, shutdown_event);
- channel->InitClient(channel_handle, create_pipe_now);
- return channel.Pass();
-}
-
-// static
-scoped_ptr<SyncChannel> SyncChannel::CreateServer(
+SyncChannel::SyncChannel(
const IPC::ChannelHandle& channel_handle,
+ Channel::Mode mode,
Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner,
bool create_pipe_now,
- base::WaitableEvent* shutdown_event) {
- scoped_ptr<SyncChannel> channel = Create(
- listener, ipc_task_runner, shutdown_event);
- channel->InitServer(channel_handle, create_pipe_now);
- return channel.Pass();
+ WaitableEvent* shutdown_event)
+ : ChannelProxy(new SyncContext(listener, ipc_task_runner, shutdown_event)) {
+ // The current (listener) thread must be distinct from the IPC thread, or else
+ // sending synchronous messages will deadlock.
+ DCHECK_NE(ipc_task_runner, base::ThreadTaskRunnerHandle::Get());
+ ChannelProxy::Init(channel_handle, mode, create_pipe_now);
+ StartWatching();
}
-// static
-scoped_ptr<SyncChannel> SyncChannel::CreateNamedClient(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner,
- bool create_pipe_now,
- base::WaitableEvent* shutdown_event) {
- scoped_ptr<SyncChannel> channel = Create(
- listener, ipc_task_runner, shutdown_event);
- channel->InitNamedClient(channel_handle, create_pipe_now);
- return channel.Pass();
-}
-
-// static
-scoped_ptr<SyncChannel> SyncChannel::CreateNamedServer(
- const IPC::ChannelHandle& channel_handle,
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner,
- bool create_pipe_now,
- base::WaitableEvent* shutdown_event) {
- scoped_ptr<SyncChannel> channel = Create(
- listener, ipc_task_runner, shutdown_event);
- channel->InitNamedServer(channel_handle, create_pipe_now);
- return channel.Pass();
-}
-
-// static
-scoped_ptr<SyncChannel> SyncChannel::Create(
- Listener* listener,
- base::SingleThreadTaskRunner* ipc_task_runner,
- WaitableEvent* shutdown_event) {
- return make_scoped_ptr(new SyncChannel(
- listener, ipc_task_runner, shutdown_event));
-}
-
SyncChannel::SyncChannel(
Listener* listener,
base::SingleThreadTaskRunner* ipc_task_runner,
« no previous file with comments | « trunk/src/ipc/ipc_sync_channel.h ('k') | trunk/src/ipc/ipc_sync_channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698