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

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

Issue 12211029: Sanity tweaks to the extension blacklist: check all extensions at once on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more test fixes Created 7 years, 10 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
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 759f3b7d271a5760e073da7d54379469dabf18cf..3cc8fa83869920aa2d0ec9276a75a729bfd57427 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -2038,6 +2038,8 @@ void ExtensionService::OnLoadedInstalledExtensions() {
if (updater_.get())
updater_->Start();
+ OnBlacklistUpdated();
+
ready_ = true;
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSIONS_READY,
@@ -2076,16 +2078,12 @@ void ExtensionService::AddExtension(const Extension* extension) {
// wipeout before, we might disable this extension here.
MaybeWipeout(extension);
- // Communicated to the Blacklist.
- std::set<std::string> already_in_blacklist;
-
if (extension_prefs_->IsExtensionBlacklisted(extension->id())) {
// Don't check the Blacklist yet because it's asynchronous (we do it at
// the end). This pre-emptive check is because we will always store the
// blacklisted state of *installed* extensions in prefs, and it's important
// not to re-enable blacklisted extensions.
blacklisted_extensions_.Insert(extension);
- already_in_blacklist.insert(extension->id());
} else if (extension_prefs_->IsExtensionDisabled(extension->id())) {
disabled_extensions_.Insert(extension);
SyncExtensionChangeIfNeeded(*extension);
@@ -2113,16 +2111,6 @@ void ExtensionService::AddExtension(const Extension* extension) {
NotifyExtensionLoaded(extension);
DoPostLoadTasks(extension);
}
-
- // Lastly, begin the process for checking the blacklist status of extensions.
- // This may need to go to other threads so is asynchronous.
- std::set<std::string> id_set;
- id_set.insert(extension->id());
- blacklist_->GetBlacklistedIDs(
- id_set,
- base::Bind(&ExtensionService::ManageBlacklist,
- AsWeakPtr(),
- already_in_blacklist));
}
void ExtensionService::AddComponentExtension(const Extension* extension) {
@@ -2481,8 +2469,8 @@ void ExtensionService::FinishInstallation(const Extension* extension) {
AddExtension(extension);
#if defined(ENABLE_THEMES)
- // We do this here since AddExtension() is always called on browser
- // startup, and we only really care about the last theme installed.
+ // We do this here since AddExtension() is always called on browser startup,
+ // and we only really care about the last theme installed.
// If that ever changes and we have to move this code somewhere
// else, it should be somewhere that's not in the startup path.
if (extension->is_theme() && extensions_.GetByID(extension->id())) {
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698