diff options
author | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 21:41:28 +0000 |
---|---|---|
committer | gregoryd@google.com <gregoryd@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-08 21:41:28 +0000 |
commit | 16e70aeca7951680226d7ad461d5c21dadccc728 (patch) | |
tree | 5b5fa67e3580d0bb30b49874927b28e96b6fb32b /chrome/browser/nacl_host/nacl_broker_host.cc | |
parent | 6ee6972c5746bb59309c80d8f96ea0dbbcd44789 (diff) | |
download | chromium_src-16e70aeca7951680226d7ad461d5c21dadccc728.zip chromium_src-16e70aeca7951680226d7ad461d5c21dadccc728.tar.gz chromium_src-16e70aeca7951680226d7ad461d5c21dadccc728.tar.bz2 |
Terminate NaCl broker process when no loader processes are running
BUG=none
TEST=none
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=40744
Review URL: http://codereview.chromium.org/669019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/nacl_host/nacl_broker_host.cc')
-rw-r--r-- | chrome/browser/nacl_host/nacl_broker_host.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/chrome/browser/nacl_host/nacl_broker_host.cc b/chrome/browser/nacl_host/nacl_broker_host.cc index f620a6a..9c33430 100644 --- a/chrome/browser/nacl_host/nacl_broker_host.cc +++ b/chrome/browser/nacl_host/nacl_broker_host.cc @@ -17,7 +17,8 @@ NaClBrokerHost::NaClBrokerHost( ResourceDispatcherHost* resource_dispatcher_host) - : ChildProcessHost(NACL_BROKER_PROCESS, resource_dispatcher_host) { + : ChildProcessHost(NACL_BROKER_PROCESS, resource_dispatcher_host), + stopping_(false) { } NaClBrokerHost::~NaClBrokerHost() { @@ -73,3 +74,18 @@ void NaClBrokerHost::OnLoaderLaunched(const std::wstring& loader_channel_id, base::ProcessHandle handle) { NaClBrokerService::GetInstance()->OnLoaderLaunched(loader_channel_id, handle); } + +void NaClBrokerHost::StopBroker() { + stopping_ = true; + Send(new NaClProcessMsg_StopBroker()); +} + +void NaClBrokerHost::OnChildDied() { + if (!stopping_) { + // If the broker stops unexpectedly (and not when asked by the broker + // service), we need to notify the broker service. In any other case + // the broker service may have a new broker host pointer by this time. + NaClBrokerService::GetInstance()->OnBrokerDied(); + } + ChildProcessHost::OnChildDied(); +} |