diff options
Diffstat (limited to 'chrome/browser/extensions/extensions_service.cc')
-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."; } |