summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/common/np_channel_base.cc10
-rw-r--r--content/common/np_channel_base.h5
-rw-r--r--content/plugin/plugin_channel.cc8
-rw-r--r--content/plugin/plugin_channel.h3
-rw-r--r--content/renderer/plugin_channel_host.cc10
-rw-r--r--content/renderer/plugin_channel_host.h3
6 files changed, 24 insertions, 15 deletions
diff --git a/content/common/np_channel_base.cc b/content/common/np_channel_base.cc
index 6ba5083..e5f8f02 100644
--- a/content/common/np_channel_base.cc
+++ b/content/common/np_channel_base.cc
@@ -10,7 +10,6 @@
#include "base/hash_tables.h"
#include "base/lazy_instance.h"
#include "base/string_number_conversions.h"
-#include "content/common/child_process.h"
#include "ipc/ipc_sync_message.h"
#if defined(OS_POSIX)
@@ -29,7 +28,7 @@ static int next_pipe_id = 0;
NPChannelBase* NPChannelBase::GetChannel(
const IPC::ChannelHandle& channel_handle, IPC::Channel::Mode mode,
ChannelFactory factory, base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now) {
+ bool create_pipe_now, base::WaitableEvent* shutdown_event) {
scoped_refptr<NPChannelBase> channel;
std::string channel_key = channel_handle.name;
ChannelMap::const_iterator iter = g_channels_.find(channel_key);
@@ -48,7 +47,7 @@ NPChannelBase* NPChannelBase::GetChannel(
channel->channel_handle_.name.append(base::IntToString(next_pipe_id++));
}
channel->mode_ = mode;
- if (channel->Init(ipc_message_loop, create_pipe_now)) {
+ if (channel->Init(ipc_message_loop, create_pipe_now, shutdown_event)) {
g_channels_[channel_key] = channel;
} else {
channel = NULL;
@@ -112,10 +111,11 @@ NPObjectBase* NPChannelBase::GetNPObjectListenerForRoute(int route_id) {
}
bool NPChannelBase::Init(base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now) {
+ bool create_pipe_now,
+ base::WaitableEvent* shutdown_event) {
channel_.reset(new IPC::SyncChannel(
channel_handle_, mode_, this, ipc_message_loop, create_pipe_now,
- ChildProcess::current()->GetShutDownEvent()));
+ shutdown_event));
channel_valid_ = true;
return true;
}
diff --git a/content/common/np_channel_base.h b/content/common/np_channel_base.h
index 9726f6d..5f0eac5 100644
--- a/content/common/np_channel_base.h
+++ b/content/common/np_channel_base.h
@@ -115,7 +115,7 @@ class NPChannelBase : public IPC::Channel::Listener,
static NPChannelBase* GetChannel(
const IPC::ChannelHandle& channel_handle, IPC::Channel::Mode mode,
ChannelFactory factory, base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now);
+ bool create_pipe_now, base::WaitableEvent* shutdown_event);
// Sends a message to all instances.
static void Broadcast(IPC::Message* message);
@@ -138,7 +138,8 @@ class NPChannelBase : public IPC::Channel::Listener,
}
virtual bool Init(base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now);
+ bool create_pipe_now,
+ base::WaitableEvent* shutdown_event);
scoped_ptr<IPC::SyncChannel> channel_;
diff --git a/content/plugin/plugin_channel.cc b/content/plugin/plugin_channel.cc
index 6d428cf..a9a12a6 100644
--- a/content/plugin/plugin_channel.cc
+++ b/content/plugin/plugin_channel.cc
@@ -148,7 +148,8 @@ PluginChannel* PluginChannel::GetPluginChannel(
IPC::Channel::MODE_SERVER,
ClassFactory,
ipc_message_loop,
- false));
+ false,
+ ChildProcess::current()->GetShutDownEvent()));
if (channel)
channel->renderer_id_ = renderer_id;
@@ -324,8 +325,9 @@ void PluginChannel::CleanUp() {
}
bool PluginChannel::Init(base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now) {
- if (!NPChannelBase::Init(ipc_message_loop, create_pipe_now))
+ bool create_pipe_now,
+ base::WaitableEvent* shutdown_event) {
+ if (!NPChannelBase::Init(ipc_message_loop, create_pipe_now, shutdown_event))
return false;
channel_->AddFilter(filter_.get());
diff --git a/content/plugin/plugin_channel.h b/content/plugin/plugin_channel.h
index 87afb8c..d2d7f0b 100644
--- a/content/plugin/plugin_channel.h
+++ b/content/plugin/plugin_channel.h
@@ -65,7 +65,8 @@ class PluginChannel : public NPChannelBase {
// Overrides NPChannelBase::Init.
virtual bool Init(base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now);
+ bool create_pipe_now,
+ base::WaitableEvent* shutdown_event);
private:
class MessageFilter;
diff --git a/content/renderer/plugin_channel_host.cc b/content/renderer/plugin_channel_host.cc
index b41db85..69ad605 100644
--- a/content/renderer/plugin_channel_host.cc
+++ b/content/renderer/plugin_channel_host.cc
@@ -4,6 +4,7 @@
#include "content/renderer/plugin_channel_host.h"
+#include "content/common/child_process.h"
#include "content/common/npobject_base.h"
#include "content/common/plugin_messages.h"
@@ -76,7 +77,8 @@ PluginChannelHost* PluginChannelHost::GetPluginChannelHost(
IPC::Channel::MODE_CLIENT,
ClassFactory,
ipc_message_loop,
- true));
+ true,
+ ChildProcess::current()->GetShutDownEvent()));
return result;
}
@@ -87,8 +89,10 @@ PluginChannelHost::~PluginChannelHost() {
}
bool PluginChannelHost::Init(base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now) {
- bool ret = NPChannelBase::Init(ipc_message_loop, create_pipe_now);
+ bool create_pipe_now,
+ base::WaitableEvent* shutdown_event) {
+ bool ret =
+ NPChannelBase::Init(ipc_message_loop, create_pipe_now, shutdown_event);
is_listening_filter_ = new IsListeningFilter;
channel_->AddFilter(is_listening_filter_);
return ret;
diff --git a/content/renderer/plugin_channel_host.h b/content/renderer/plugin_channel_host.h
index a12fca6..38e0bf7 100644
--- a/content/renderer/plugin_channel_host.h
+++ b/content/renderer/plugin_channel_host.h
@@ -22,7 +22,8 @@ class PluginChannelHost : public NPChannelBase {
base::MessageLoopProxy* ipc_message_loop);
virtual bool Init(base::MessageLoopProxy* ipc_message_loop,
- bool create_pipe_now);
+ bool create_pipe_now,
+ base::WaitableEvent* shutdown_event);
virtual int GenerateRouteID();