summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 20:48:53 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-02 20:48:53 +0000
commit31f772629aebba90181e0a6fb7adea5cabe68c19 (patch)
tree947357e11f532a085de710552d657996eb6e9f96 /chrome/browser/extensions
parentaf3113ef6629b7ebc0cec009786b3abd26a36cad (diff)
downloadchromium_src-31f772629aebba90181e0a6fb7adea5cabe68c19.zip
chromium_src-31f772629aebba90181e0a6fb7adea5cabe68c19.tar.gz
chromium_src-31f772629aebba90181e0a6fb7adea5cabe68c19.tar.bz2
Unload the entire extension when any part of it crashes.
Also enable the task_manager_browsertest.cc (where I added the new test) on Linux. TEST=Covered by browser_tests. BUG=21635 Review URL: http://codereview.chromium.org/465007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33599 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r--chrome/browser/extensions/extensions_service.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index b00b33d..8eba54f 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -121,6 +121,8 @@ ExtensionsService::ExtensionsService(Profile* profile,
registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING,
NotificationService::AllSources());
+ registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED,
+ Source<Profile>(profile_));
// Set up the ExtensionUpdater
if (autoupdate_enabled) {
@@ -838,6 +840,16 @@ void ExtensionsService::Observe(NotificationType type,
break;
}
+ case NotificationType::EXTENSION_PROCESS_CRASHED: {
+ DCHECK_EQ(profile_, Source<Profile>(source).ptr());
+ ExtensionHost* host = Details<ExtensionHost>(details).ptr();
+
+ // Unload the entire extension. We want it to be in a consistent state:
+ // either fully working or not loaded at all, but never half-crashed.
+ UnloadExtension(host->extension()->id());
+ break;
+ }
+
default:
NOTREACHED() << "Unexpected notification type.";
}