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

Unified Diff: chrome/browser/safe_browsing/unverified_download_field_trial.h

Issue 1409003002: [SafeBrowsing] Block dangerous unchecked downloads based on a Finch trial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/unverified_download_field_trial.h
diff --git a/chrome/browser/safe_browsing/unverified_download_field_trial.h b/chrome/browser/safe_browsing/unverified_download_field_trial.h
new file mode 100644
index 0000000000000000000000000000000000000000..4d9432a5cc3e41bf9baa6b057a73c6634bed8c34
--- /dev/null
+++ b/chrome/browser/safe_browsing/unverified_download_field_trial.h
@@ -0,0 +1,62 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_FIELD_TRIAL_H_
+#define CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_FIELD_TRIAL_H_
+
+namespace base {
+class FilePath;
+}
+
+namespace safe_browsing {
+
+// Unverified Download Field Trial
+//
+// It is possible in some circumstances to download a file without invoking
+// SafeBrowsing to verify the source URLs or the downloaded contents. Ideally
+// all code paths that writes untrusted contents to disk in a user discoverable
+// manner would invoke SafeBrowsing. But until all such code paths are properly
+// plumbed, this field trial will help control the behavior of known unverified
+// code paths.
+
+extern const char kUnverifiedDownloadFieldTrialName[];
+
+// The trial groups are:
+//
+// * DisableAll : Disables all unverified downloads regardless of whether the
+// specific file in question is potentially dangerous or handled by Safe
+// Browsing at all.
+extern const char kUnverifiedDownloadFieldTrialDisableAll[];
+
+// * DisableByParameter : Decides the fate of unverified downloads based on
+// whether the file type matches a whitelist and a blacklist specified as a
+// parameter to this trial group. Any file type that doesn't match either of
+// these lists will default to being allowed.
+extern const char kUnverifiedDownloadFieldTrialDisableByParameter[];
+
+// The parameters are:
+//
+// - 'whitelist' : A comma separated list of file types including leading
+// extension separator. E.g. ".abc,.def" would match both foo.abc and
+// foo.def, but not foo.txt. Any matching file will be allowed to be
+// downloaded.
+extern const char kUnverifiedDownloadFieldTrialWhitelistParam[];
+
+// - 'blacklist' : Similar in format to 'whitelist' but causes matching file
+// types to be disallowed from downloading.
+extern const char kUnverifiedDownloadFieldTrialBlacklistParam[];
+
+// * DisableSBTypesAndByParameter : Applies the whitelist and blacklist as
+// described in DisableByParameter. However, any file type that doesn't
+// match either list but is considered supported by SafeBrowsing will be
+// blocked.
+extern const char kUnverifiedDownloadFieldTrialDisableSBTypesAndByParameter[];
+
+// Returns true if |file| is allowed to be downloaded based on the current field
+// trial settings.
+bool IsUnverifiedDownloadAllowedByFieldTrial(const base::FilePath& file);
+
+} // namespace safe_browsing
+
+#endif // CHROME_BROWSER_SAFE_BROWSING_UNVERIFIED_DOWNLOAD_FIELD_TRIAL_H_
« no previous file with comments | « chrome/browser/file_select_helper_unittest.cc ('k') | chrome/browser/safe_browsing/unverified_download_field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698