summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-11 02:19:50 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-11 02:19:50 +0000
commit82aa72dfc7fb4aebea7857ce0c896434f18167bb (patch)
tree18eb0e931732a2e14d80e80586edacdbdec573c2
parent6024ce656f291da0954ad450dcd22570ac119c1b (diff)
downloadchromium_src-82aa72dfc7fb4aebea7857ce0c896434f18167bb.zip
chromium_src-82aa72dfc7fb4aebea7857ce0c896434f18167bb.tar.gz
chromium_src-82aa72dfc7fb4aebea7857ce0c896434f18167bb.tar.bz2
Extensions: don't send EXTENSION_PROCESS_CRASHED when the extension process is fast-terminated (i.e., didn't crash).
BUG=30057 Review URL: http://codereview.chromium.org/492014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34321 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/extensions/extension_host.cc24
-rw-r--r--chrome/browser/extensions/extension_host.h1
2 files changed, 15 insertions, 10 deletions
diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc
index 767da27..8407fc4 100644
--- a/chrome/browser/extensions/extension_host.cc
+++ b/chrome/browser/extensions/extension_host.cc
@@ -131,6 +131,8 @@ ExtensionHost::ExtensionHost(Extension* extension, SiteInstance* site_instance,
// to the task manager then.
registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED,
Source<RenderProcessHost>(render_process_host()));
+ registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED,
+ Source<RenderProcessHost>(render_process_host()));
}
ExtensionHost::~ExtensionHost() {
@@ -231,6 +233,19 @@ void ExtensionHost::Observe(NotificationType type,
NotificationType::EXTENSION_PROCESS_CREATED,
Source<Profile>(profile_),
Details<ExtensionHost>(this));
+ } else if (type == NotificationType::RENDERER_PROCESS_CLOSED) {
+ Details<RenderProcessHost::RendererClosedDetails> closed_details =
+ static_cast<Details<RenderProcessHost::RendererClosedDetails> >(
+ details);
+ DCHECK(closed_details->was_extension_renderer);
+ if (!closed_details->did_crash)
+ return;
+
+ LOG(INFO) << "Sending EXTENSION_PROCESS_CRASHED for " + extension_->name();
+ NotificationService::current()->Notify(
+ NotificationType::EXTENSION_PROCESS_CRASHED,
+ Source<Profile>(profile_),
+ Details<ExtensionHost>(this));
} else {
NOTREACHED();
}
@@ -241,15 +256,6 @@ void ExtensionHost::UpdatePreferredSize(const gfx::Size& new_size) {
view_->UpdatePreferredSize(new_size);
}
-void ExtensionHost::RenderViewGone(RenderViewHost* render_view_host) {
- LOG(INFO) << "Sending EXTENSION_PROCESS_CRASHED for " + extension_->name();
- DCHECK_EQ(render_view_host_, render_view_host);
- NotificationService::current()->Notify(
- NotificationType::EXTENSION_PROCESS_CRASHED,
- Source<Profile>(profile_),
- Details<ExtensionHost>(this));
-}
-
void ExtensionHost::DidNavigate(RenderViewHost* render_view_host,
const ViewHostMsg_FrameNavigate_Params& params) {
// We only care when the outer frame changes.
diff --git a/chrome/browser/extensions/extension_host.h b/chrome/browser/extensions/extension_host.h
index 5f2188c..df03314 100644
--- a/chrome/browser/extensions/extension_host.h
+++ b/chrome/browser/extensions/extension_host.h
@@ -104,7 +104,6 @@ class ExtensionHost : public ExtensionPopupHost::PopupDelegate,
virtual void RenderViewCreated(RenderViewHost* render_view_host);
virtual ViewType::Type GetRenderViewType() const;
virtual int GetBrowserWindowID() const;
- virtual void RenderViewGone(RenderViewHost* render_view_host);
virtual void DidNavigate(RenderViewHost* render_view_host,
const ViewHostMsg_FrameNavigate_Params& params);
virtual void DidStopLoading();