From e72bd1fc6117bde3d7f95c250fd8ef68bd50853b Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Fri, 11 Dec 2009 03:19:39 +0000 Subject: Revert r34321 as it breaks the task manager: ------------------------------------------------------------------------ r34321 | estade@chromium.org | 2009-12-10 18:19:50 -0800 (Thu, 10 Dec 2009) | 5 lines 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 Review URL: http://codereview.chromium.org/487023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34324 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/extensions/extension_host.cc | 24 +++++++++--------------- chrome/browser/extensions/extension_host.h | 1 + 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'chrome/browser/extensions') diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index 8407fc4..767da27 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -131,8 +131,6 @@ ExtensionHost::ExtensionHost(Extension* extension, SiteInstance* site_instance, // to the task manager then. registrar_.Add(this, NotificationType::RENDERER_PROCESS_CREATED, Source(render_process_host())); - registrar_.Add(this, NotificationType::RENDERER_PROCESS_CLOSED, - Source(render_process_host())); } ExtensionHost::~ExtensionHost() { @@ -233,19 +231,6 @@ void ExtensionHost::Observe(NotificationType type, NotificationType::EXTENSION_PROCESS_CREATED, Source(profile_), Details(this)); - } else if (type == NotificationType::RENDERER_PROCESS_CLOSED) { - Details closed_details = - static_cast >( - 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_), - Details(this)); } else { NOTREACHED(); } @@ -256,6 +241,15 @@ 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_), + Details(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 df03314..5f2188c 100644 --- a/chrome/browser/extensions/extension_host.h +++ b/chrome/browser/extensions/extension_host.h @@ -104,6 +104,7 @@ 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(); -- cgit v1.1