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

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

Issue 23591050: Delete the omahaproxy-backed extension blacklist and clear its entries from the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix memory leak in blacklist test Created 7 years, 3 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 500e5b80fd08659e88ecde78193050ba3c16b45c..1e7ae32cd7f73c264bae8a8f2e07ad74ac7b9f22 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -414,7 +414,6 @@ ExtensionService::ExtensionService(Profile* profile,
extension_prefs,
profile->GetPrefs(),
profile,
- blacklist,
update_frequency));
}
@@ -3095,32 +3094,29 @@ void ExtensionService::OnNeedsToGarbageCollectIsolatedStorage() {
void ExtensionService::OnBlacklistUpdated() {
blacklist_->GetBlacklistedIDs(
GenerateInstalledExtensionsSet()->GetIDs(),
- base::Bind(&ExtensionService::ManageBlacklist,
- AsWeakPtr(),
- blacklisted_extensions_.GetIDs()));
+ base::Bind(&ExtensionService::ManageBlacklist, AsWeakPtr()));
}
-void ExtensionService::ManageBlacklist(
- const std::set<std::string>& old_blacklisted_ids,
- const std::set<std::string>& new_blacklisted_ids) {
+void ExtensionService::ManageBlacklist(const std::set<std::string>& updated) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ std::set<std::string> before = blacklisted_extensions_.GetIDs();
std::set<std::string> no_longer_blacklisted =
- base::STLSetDifference<std::set<std::string> >(old_blacklisted_ids,
- new_blacklisted_ids);
+ base::STLSetDifference<std::set<std::string> >(before, updated);
std::set<std::string> not_yet_blacklisted =
- base::STLSetDifference<std::set<std::string> >(new_blacklisted_ids,
- old_blacklisted_ids);
+ base::STLSetDifference<std::set<std::string> >(updated, before);
for (std::set<std::string>::iterator it = no_longer_blacklisted.begin();
it != no_longer_blacklisted.end(); ++it) {
scoped_refptr<const Extension> extension =
blacklisted_extensions_.GetByID(*it);
- DCHECK(extension.get()) << "Extension " << *it << " no longer blacklisted, "
- << "but it was never blacklisted.";
- if (!extension.get())
+ if (!extension.get()) {
+ NOTREACHED() << "Extension " << *it << " no longer blacklisted, "
+ << "but it was never blacklisted.";
continue;
+ }
blacklisted_extensions_.Remove(*it);
+ extension_prefs_->SetExtensionBlacklisted(extension->id(), false);
AddExtension(extension.get());
UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.UnblacklistInstalled",
extension->location(),
@@ -3130,11 +3126,13 @@ void ExtensionService::ManageBlacklist(
for (std::set<std::string>::iterator it = not_yet_blacklisted.begin();
it != not_yet_blacklisted.end(); ++it) {
scoped_refptr<const Extension> extension = GetInstalledExtension(*it);
- DCHECK(extension.get()) << "Extension " << *it << " needs to be "
- << "blacklisted, but it's not installed.";
- if (!extension.get())
+ if (!extension.get()) {
+ NOTREACHED() << "Extension " << *it << " needs to be "
+ << "blacklisted, but it's not installed.";
continue;
+ }
blacklisted_extensions_.Insert(extension);
+ extension_prefs_->SetExtensionBlacklisted(extension->id(), true);
UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
UMA_HISTOGRAM_ENUMERATION("ExtensionBlacklist.BlacklistInstalled",
extension->location(), Manifest::NUM_LOCATIONS);
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698