diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-13 18:42:44 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-13 18:42:44 +0000 |
commit | 3001324f90ac31f78c2fbfc526e14aa13ff27422 (patch) | |
tree | 3250614a301430ed349d1cdf48bd9c13fec3f6c5 /chrome/browser/extensions | |
parent | 362ab2b8a44d482303ac4f0218a1581ff93bb16b (diff) | |
download | chromium_src-3001324f90ac31f78c2fbfc526e14aa13ff27422.zip chromium_src-3001324f90ac31f78c2fbfc526e14aa13ff27422.tar.gz chromium_src-3001324f90ac31f78c2fbfc526e14aa13ff27422.tar.bz2 |
Merge 33599 - 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
TBR=phajdan.jr@chromium.org
Review URL: http://codereview.chromium.org/491072
git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@34448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions')
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 141c49d..2de031f 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -125,6 +125,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) { @@ -834,6 +836,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."; } |