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

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 8417054: Allow proxy channels to be created without initializing the underlying channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 1 month 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 26d285a9f93c5405289e80ecdaaf523058cccb8f..fb365d61ac122e9d071bbe40bcb8a642f0873e25 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -285,18 +285,15 @@ ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,
Channel::Listener* listener,
base::MessageLoopProxy* ipc_thread)
: context_(new Context(listener, ipc_thread)),
- outgoing_message_filter_(NULL) {
- Init(channel_handle, mode, ipc_thread, true);
+ outgoing_message_filter_(NULL),
+ did_init_(false) {
+ Init(channel_handle, mode, true);
}
-ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,
- Channel::Mode mode,
- base::MessageLoopProxy* ipc_thread,
- Context* context,
- bool create_pipe_now)
+ChannelProxy::ChannelProxy(Context* context)
: context_(context),
- outgoing_message_filter_(NULL) {
- Init(channel_handle, mode, ipc_thread, create_pipe_now);
+ outgoing_message_filter_(NULL),
+ did_init_(false) {
}
ChannelProxy::~ChannelProxy() {
@@ -305,8 +302,8 @@ ChannelProxy::~ChannelProxy() {
void ChannelProxy::Init(const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
- base::MessageLoopProxy* ipc_thread_loop,
bool create_pipe_now) {
+ DCHECK(!did_init_);
#if defined(OS_POSIX)
// When we are creating a server on POSIX, we need its file descriptor
// to be created immediately so that it can be accessed and passed
@@ -332,6 +329,8 @@ void ChannelProxy::Init(const IPC::ChannelHandle& channel_handle,
// complete initialization on the background thread
context_->ipc_message_loop()->PostTask(
FROM_HERE, base::Bind(&Context::OnChannelOpened, context_.get()));
+
+ did_init_ = true;
}
void ChannelProxy::Close() {
@@ -347,6 +346,7 @@ void ChannelProxy::Close() {
}
bool ChannelProxy::Send(Message* message) {
+ DCHECK(did_init_);
if (outgoing_message_filter())
message = outgoing_message_filter()->Rewrite(message);
« 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