Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4375)

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 465007: Unload the entire extension when any part of it crashes. (Closed)
Patch Set: Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/task_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.";
}
« no previous file with comments | « no previous file | chrome/browser/task_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698