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

Unified Diff: chrome/common/safe_browsing/file_type_policies.h

Issue 2072933002: Add sampling of unknown filetypes in download protection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add int values for histograms to ensure they match Created 4 years, 6 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/common/safe_browsing/csd.proto ('k') | chrome/common/safe_browsing/file_type_policies.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/safe_browsing/file_type_policies.h
diff --git a/chrome/common/safe_browsing/file_type_policies.h b/chrome/common/safe_browsing/file_type_policies.h
index f50d3a6ff6feaf13f4a12326ddc72d23a88d1611..7aed0a8b1c1bff1c60a04d366b28546cffa15c59 100644
--- a/chrome/common/safe_browsing/file_type_policies.h
+++ b/chrome/common/safe_browsing/file_type_policies.h
@@ -16,6 +16,7 @@
namespace safe_browsing {
struct FileTypePoliciesSingletonTrait;
+class FileTypePoliciesTestOverlay;
// This holds a list of file types (aka file extensions) that we know about,
// with policies related to how Safe Browsing and the download UI should treat
@@ -67,6 +68,10 @@ class FileTypePolicies {
DownloadFileType::DangerLevel GetFileDangerLevel(
const base::FilePath& file) const;
+ // Return the type of ping we should send for this file
+ DownloadFileType::PingSetting PingSettingForFile(
+ const base::FilePath& file) const;
+
float SampledPingProbability() const;
DownloadFileType PolicyForFile(const base::FilePath& file) const;
@@ -108,6 +113,10 @@ class FileTypePolicies {
const std::string& ext) const;
private:
+ // Swap in a different config. This will rebuild file_type_by_ext_ index.
+ void SwapConfig(std::unique_ptr<DownloadFileTypeConfig>& new_config);
+ void SwapConfigLocked(std::unique_ptr<DownloadFileTypeConfig>& new_config);
+
// Read data from the main ResourceBundle. This updates the internal list
// only if the data passes integrity checks. This is normally called once
// after construction.
@@ -132,6 +141,7 @@ class FileTypePolicies {
FRIEND_TEST_ALL_PREFIXES(FileTypePoliciesTest, BadUpdateFromExisting);
friend struct FileTypePoliciesSingletonTrait;
+ friend class FileTypePoliciesTestOverlay;
};
} // namespace safe_browsing
« no previous file with comments | « chrome/common/safe_browsing/csd.proto ('k') | chrome/common/safe_browsing/file_type_policies.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698