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

Unified Diff: chrome/browser/extensions/blacklist.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
« no previous file with comments | « chrome/browser/extensions/blacklist.h ('k') | chrome/browser/extensions/crx_installer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/blacklist.cc
diff --git a/chrome/browser/extensions/blacklist.cc b/chrome/browser/extensions/blacklist.cc
index 03fac3590734834e0cac499a36c32dbdf85d2b85..5b9fac0ed5aaebe61b3871914219de80d43c1b95 100644
--- a/chrome/browser/extensions/blacklist.cc
+++ b/chrome/browser/extensions/blacklist.cc
@@ -112,6 +112,11 @@ class SafeBrowsingClientImpl
DISALLOW_COPY_AND_ASSIGN(SafeBrowsingClientImpl);
};
+void IsNotEmpty(const Blacklist::IsBlacklistedCallback& callback,
+ const std::set<std::string>& set) {
+ callback.Run(!set.empty());
+}
+
} // namespace
Blacklist::Observer::Observer(Blacklist* blacklist) : blacklist_(blacklist) {
@@ -157,6 +162,13 @@ void Blacklist::GetBlacklistedIDs(const std::set<std::string>& ids,
const GetBlacklistedIDsCallback& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if (ids.empty()) {
+ base::MessageLoopProxy::current()->PostTask(
+ FROM_HERE,
+ base::Bind(callback, std::set<std::string>()));
+ return;
+ }
+
// The blacklisted IDs are the union of those blacklisted in prefs and
// those blacklisted from safe browsing.
std::set<std::string> pref_blacklisted_ids;
@@ -182,6 +194,13 @@ void Blacklist::GetBlacklistedIDs(const std::set<std::string>& ids,
callback));
}
+void Blacklist::IsBlacklisted(const std::string& extension_id,
+ const IsBlacklistedCallback& callback) {
+ std::set<std::string> check;
+ check.insert(extension_id);
+ GetBlacklistedIDs(check, base::Bind(&IsNotEmpty, callback));
+}
+
void Blacklist::SetFromUpdater(const std::vector<std::string>& ids,
const std::string& version) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
« no previous file with comments | « chrome/browser/extensions/blacklist.h ('k') | chrome/browser/extensions/crx_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698