| Index: chrome/browser/extensions/extensions_service.cc
|
| diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
|
| index b00b33d68a66f369d15c466763c017b40fc8ee7b..8eba54fd7529da09bbcdd88e8444c510a17a0859 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.";
|
| }
|
|
|