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

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: mpcomplete 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 5617fb921cc72ee43c69857c9835ff5e360edb15..5efcbc268d0f1334efd8af1ef2a179c7d24bd843 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -2035,10 +2035,15 @@ void ExtensionService::SyncExtensionChangeIfNeeded(const Extension& extension) {
}
void ExtensionService::OnLoadedInstalledExtensions() {
+ DCHECK(!ready_);
+
if (updater_.get())
updater_->Start();
+ OnBlacklistUpdated();
+
ready_ = true;
+
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_EXTENSIONS_READY,
content::Source<Profile>(profile_),
@@ -2076,16 +2081,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 +2114,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 +2472,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())) {

Powered by Google App Engine
This is Rietveld 408576698