summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authormpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-05 00:50:53 +0000
committermpcomplete@google.com <mpcomplete@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-05 00:50:53 +0000
commit6ba2ec2e23f79f1882263a4fb1cd12efc0651e88 (patch)
treeefbcef6f1224e165fee0ebd987dd0fc567d13fe4 /chrome/browser
parent10235beedc6fbfdb50453a7568e3279c25714624 (diff)
downloadchromium_src-6ba2ec2e23f79f1882263a4fb1cd12efc0651e88.zip
chromium_src-6ba2ec2e23f79f1882263a4fb1cd12efc0651e88.tar.gz
chromium_src-6ba2ec2e23f79f1882263a4fb1cd12efc0651e88.tar.bz2
Add a RENDERER_PROCESS_CLOSED notification that gets sent when we close the
RenderProcessHost's process_. This is similar to RENDER_PROCESS_TERMINATED, but the latter is not always sent since the process could get reused. It also takes the place of RENDERER_PROCESS_CRASHED, where this one contains a boolean Details indicating whether the process crashed (true) or just exited (false). Review URL: http://codereview.chromium.org/100277 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cert_store.cc4
-rwxr-xr-xchrome/browser/extensions/extension_message_service.cc5
-rw-r--r--chrome/browser/metrics/metrics_service.cc7
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc11
4 files changed, 15 insertions, 12 deletions
diff --git a/chrome/browser/cert_store.cc b/chrome/browser/cert_store.cc
index 55fdc5a..7837380 100644
--- a/chrome/browser/cert_store.cc
+++ b/chrome/browser/cert_store.cc
@@ -42,7 +42,7 @@ CertStore::CertStore() : next_cert_id_(1) {
NotificationType::RENDERER_PROCESS_TERMINATED,
NotificationService::AllSources());
NotificationService::current()->AddObserver(this,
- NotificationType::RENDERER_PROCESS_CRASHED,
+ NotificationType::RENDERER_PROCESS_CLOSED,
NotificationService::AllSources());
}
@@ -139,7 +139,7 @@ void CertStore::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
DCHECK(type == NotificationType::RENDERER_PROCESS_TERMINATED ||
- type == NotificationType::RENDERER_PROCESS_CRASHED);
+ type == NotificationType::RENDERER_PROCESS_CLOSED);
RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr();
DCHECK(rph);
RemoveCertsForRenderProcesHost(rph->pid());
diff --git a/chrome/browser/extensions/extension_message_service.cc b/chrome/browser/extensions/extension_message_service.cc
index afac5c9..4a96c12 100755
--- a/chrome/browser/extensions/extension_message_service.cc
+++ b/chrome/browser/extensions/extension_message_service.cc
@@ -81,7 +81,7 @@ void ExtensionMessageService::Init() {
NotificationType::RENDERER_PROCESS_TERMINATED,
NotificationService::AllSources());
NotificationService::current()->AddObserver(this,
- NotificationType::RENDERER_PROCESS_CRASHED,
+ NotificationType::RENDERER_PROCESS_CLOSED,
NotificationService::AllSources());
}
@@ -214,7 +214,8 @@ void ExtensionMessageService::Observe(NotificationType type,
DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI);
DCHECK(type.value == NotificationType::RENDERER_PROCESS_TERMINATED ||
- type.value == NotificationType::RENDERER_PROCESS_CRASHED);
+ type.value == NotificationType::RENDERER_PROCESS_CLOSED);
+
RenderProcessHost* renderer = Source<RenderProcessHost>(source).ptr();
{
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index c54b36e..21adc52 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -505,8 +505,9 @@ void MetricsService::Observe(NotificationType type,
LogLoadStarted();
break;
- case NotificationType::RENDERER_PROCESS_CRASHED:
- LogRendererCrash();
+ case NotificationType::RENDERER_PROCESS_CLOSED:
+ if (*Details<bool>(details).ptr())
+ LogRendererCrash();
break;
case NotificationType::RENDERER_PROCESS_HANG:
@@ -796,7 +797,7 @@ void MetricsService::ListenerRegistration(bool start_listening) {
AddOrRemoveObserver(this, NotificationType::LOAD_STOP, start_listening);
AddOrRemoveObserver(this, NotificationType::RENDERER_PROCESS_IN_SBOX,
start_listening);
- AddOrRemoveObserver(this, NotificationType::RENDERER_PROCESS_CRASHED,
+ AddOrRemoveObserver(this, NotificationType::RENDERER_PROCESS_CLOSED,
start_listening);
AddOrRemoveObserver(this, NotificationType::RENDERER_PROCESS_HANG,
start_listening);
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index f7e12c9..baef4bd 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -673,11 +673,12 @@ void BrowserRenderProcessHost::OnChannelError() {
DCHECK(channel_.get());
bool child_exited;
- if (base::DidProcessCrash(&child_exited, process_.handle())) {
- NotificationService::current()->Notify(
- NotificationType::RENDERER_PROCESS_CRASHED,
- Source<RenderProcessHost>(this), NotificationService::NoDetails());
- }
+ bool did_crash = base::DidProcessCrash(&child_exited, process_.handle());
+
+ NotificationService::current()->Notify(
+ NotificationType::RENDERER_PROCESS_CLOSED,
+ Source<RenderProcessHost>(this),
+ Details<bool>(&did_crash));
// POSIX: If the process crashed, then the kernel closed the socket for it
// and so the child has already died by the time we get here. Since