summaryrefslogtreecommitdiffstats
path: root/content/common/np_channel_base.cc
diff options
context:
space:
mode:
authorsteveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 11:57:36 +0000
committersteveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-20 11:57:36 +0000
commit4a9e852a691dbd67d8c178744e335a23330d253a (patch)
treeb50155b7e89479c02f3e47fa16afc6d3b1cee85e /content/common/np_channel_base.cc
parentb5be69a9c65e5a8e9c9912cb48336b069b67ed59 (diff)
downloadchromium_src-4a9e852a691dbd67d8c178744e335a23330d253a.zip
chromium_src-4a9e852a691dbd67d8c178744e335a23330d253a.tar.gz
chromium_src-4a9e852a691dbd67d8c178744e335a23330d253a.tar.bz2
Add shutdown event argument to NPChannelBase::GetChannel()
Currently NPChannelBase uses ChildProcess::current()->GetShutDownEvent() as the shutdown event for its underlying SyncChannel. This change allows child classes to specify their own shutdown event. This is required to allow NPChannelBase to be used between the renderer and non-child processes. This change is refactoring only and introduces no change in behaviour. BUG=96703 Review URL: http://codereview.chromium.org/7971006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/np_channel_base.cc')
-rw-r--r--content/common/np_channel_base.cc10
1 files changed, 5 insertions, 5 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;
}