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

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

Issue 3210007: Add support for a "split" incognito behavior for extensions. (Closed)
Patch Set: latest Created 10 years, 4 months 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 | « chrome/browser/extensions/extension_ui_unittest.cc ('k') | chrome/browser/extensions/extensions_ui.h » ('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 5ea1edef51dd2e20dea7d6ae2511f4b0dd7746b1..947e45e5a1e9ce4cb1b0c2125b50f8b934a794a7 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -204,7 +204,7 @@ ExtensionsService::ExtensionsService(Profile* profile,
registrar_.Add(this, NotificationType::EXTENSION_HOST_DID_STOP_LOADING,
NotificationService::AllSources());
registrar_.Add(this, NotificationType::EXTENSION_PROCESS_TERMINATED,
- Source<Profile>(profile_));
+ NotificationService::AllSources());
prefs->AddPrefObserver(prefs::kExtensionInstallAllowList, this);
prefs->AddPrefObserver(prefs::kExtensionInstallDenyList, this);
@@ -1358,7 +1358,8 @@ void ExtensionsService::Observe(NotificationType type,
}
case NotificationType::EXTENSION_PROCESS_TERMINATED: {
- DCHECK_EQ(profile_, Source<Profile>(source).ptr());
+ if (profile_ != Source<Profile>(source).ptr()->GetOriginalProfile())
+ break;
ExtensionHost* host = Details<ExtensionHost>(details).ptr();
@@ -1377,7 +1378,11 @@ void ExtensionsService::Observe(NotificationType type,
// 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());
+ // We do it in a PostTask so that other handlers of this notification will
+ // still have access to the Extension and ExtensionHost.
+ MessageLoop::current()->PostTask(FROM_HERE,
+ NewRunnableMethod(this, &ExtensionsService::UnloadExtension,
+ host->extension()->id()));
break;
}
« no previous file with comments | « chrome/browser/extensions/extension_ui_unittest.cc ('k') | chrome/browser/extensions/extensions_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698