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

Unified Diff: chrome/browser/safe_browsing/local_database_manager.cc

Issue 1638223003: Add support for a module whitelist (goog-whitemodule-digest256) to the safe browsing db (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix browser test Created 4 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/safe_browsing/local_database_manager.cc
diff --git a/chrome/browser/safe_browsing/local_database_manager.cc b/chrome/browser/safe_browsing/local_database_manager.cc
index 19e52ca72ff171f624cafd0184990a556e785391..9763d6eb649d869ccf3777dfa697d6542b6a8a67 100644
--- a/chrome/browser/safe_browsing/local_database_manager.cc
+++ b/chrome/browser/safe_browsing/local_database_manager.cc
@@ -94,6 +94,7 @@ ListType GetHashSeverestThreatListType(
case CSDWHITELIST: // Falls through.
case DOWNLOADWHITELIST: // Falls through.
case INCLUSIONWHITELIST: // Falls through.
+ case MODULEWHITELIST: // Falls through.
case EXTENSIONBLACKLIST: // Falls through.
case IPBLACKLIST:
if (index)
@@ -139,6 +140,7 @@ ListType GetUrlSeverestThreatListType(
case CSDWHITELIST: // Falls through.
case DOWNLOADWHITELIST: // Falls through.
case INCLUSIONWHITELIST: // Falls through.
+ case MODULEWHITELIST: // Falls through.
case EXTENSIONBLACKLIST: // Falls through.
case IPBLACKLIST:
return threat;
@@ -268,6 +270,7 @@ LocalSafeBrowsingDatabaseManager::LocalSafeBrowsingDatabaseManager(
enable_extension_blacklist_(false),
enable_ip_blacklist_(false),
enable_unwanted_software_blacklist_(true),
+ enable_module_whitelist_(true),
update_in_progress_(false),
database_update_in_progress_(false),
closing_database_(false),
@@ -433,6 +436,15 @@ bool LocalSafeBrowsingDatabaseManager::MatchInclusionWhitelistUrl(
return database_->ContainsInclusionWhitelistedUrl(url);
}
+bool LocalSafeBrowsingDatabaseManager::MatchModuleWhitelistString(
+ const std::string& str) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ if (!enabled_ || !enable_module_whitelist_ || !MakeDatabaseAvailable()) {
+ return true;
+ }
+ return database_->ContainsModuleWhitelistedString(str);
+}
+
bool LocalSafeBrowsingDatabaseManager::IsMalwareKillSwitchOn() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!enabled_ || !MakeDatabaseAvailable()) {
@@ -780,7 +792,7 @@ SafeBrowsingDatabase* LocalSafeBrowsingDatabaseManager::GetDatabase() {
safe_browsing_task_runner_, enable_download_protection_,
enable_csd_whitelist_, enable_download_whitelist_,
enable_extension_blacklist_, enable_ip_blacklist_,
- enable_unwanted_software_blacklist_);
+ enable_unwanted_software_blacklist_, enable_module_whitelist_);
database->Init(SafeBrowsingService::GetBaseFilename());
{
« no previous file with comments | « chrome/browser/safe_browsing/local_database_manager.h ('k') | chrome/browser/safe_browsing/safe_browsing_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698