1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
// Copyright (c) 2017 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.
#include "components/safe_browsing/features.h"
#include <stddef.h>
#include <algorithm>
#include <utility>
#include <vector>
#include "base/feature_list.h"
#include "base/macros.h"
#include "base/values.h"
namespace safe_browsing {
// Please define any new SafeBrowsing related features in this file, and add
// them to the ExperimentalFeaturesList below to start displaying their status
// on the chrome://safe-browsing page.
// Allows an ad sample report to be created but not sent. Used to measure
// performance impact of report generation.
const base::Feature kAdSamplerCollectButDontSendFeature{
"SafeBrowsingAdSamplerCollectButDontSend",
base::FEATURE_DISABLED_BY_DEFAULT};
// Controls various parameters related to occasionally collecting ad samples,
// for example to control how often collection should occur.
const base::Feature kAdSamplerTriggerFeature{"SafeBrowsingAdSamplerTrigger",
base::FEATURE_DISABLED_BY_DEFAULT};
// If enabled in pre-network-service world, SafeBrowsing URL checks are done by
// applying SafeBrowsing's URLLoaderThrottle subclasses to ThrottlingURLLoader.
// It affects:
// - subresource loading from renderers;
// - frame resource loading from the browser, if
// content::IsNavigationMojoResponseEnabled() is true.
//
// This flag has no effect if network service is enabled. With network service,
// SafeBrowsing URL checks are always done by SafeBrowsing's URLLoaderThrottle
// subclasses.
const base::Feature kCheckByURLLoaderThrottle{
"S13nSafeBrowsingCheckByURLLoaderThrottle",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kGaiaPasswordReuseReporting{
"SyncPasswordReuseEvent", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kGoogleBrandedPhishingWarning{
"PasswordProtectionGoogleBrandedPhishingWarning",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kThreatDomDetailsTagAndAttributeFeature{
"ThreatDomDetailsTagAttributes", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kTriggerThrottlerDailyQuotaFeature{
"SafeBrowsingTriggerThrottlerDailyQuota",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kDispatchSafetyNetCheckOffThread{
"DispatchSafetyNetCheckOffThread", base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kAppendRecentNavigationEvents{
"AppendRecentNavigationEvents", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kInspectDownloadedRarFiles{
"InspectDownloadedRarFiles", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kEnterprisePasswordProtectionV1{
"EnterprisePasswordProtectionV1", base::FEATURE_DISABLED_BY_DEFAULT};
namespace {
// List of experimental features. Boolean value for each list member should be
// set to true if the experiment is currently running at a probability other
// than 1 or 0, or to false otherwise.
constexpr struct {
const base::Feature* feature;
// True if the feature is running at a probability other than 1 or 0.
bool probabilistically_enabled;
} kExperimentalFeatures[]{
{&kAdSamplerCollectButDontSendFeature, false},
{&kAdSamplerTriggerFeature, false},
{&kAppendRecentNavigationEvents, true},
{&kCheckByURLLoaderThrottle, true},
{&kDispatchSafetyNetCheckOffThread, false},
{&kEnterprisePasswordProtectionV1, true},
{&kGaiaPasswordReuseReporting, true},
{&kGoogleBrandedPhishingWarning, true},
{&kInspectDownloadedRarFiles, true},
{&kThreatDomDetailsTagAndAttributeFeature, false},
{&kTriggerThrottlerDailyQuotaFeature, false},
};
// Adds the name and the enabled/disabled status of a given feature.
void AddFeatureAndAvailability(const base::Feature* exp_feature,
base::ListValue* param_list) {
param_list->GetList().push_back(base::Value(exp_feature->name));
if (base::FeatureList::IsEnabled(*exp_feature)) {
param_list->GetList().push_back(base::Value("Enabled"));
} else {
param_list->GetList().push_back(base::Value("Disabled"));
}
}
} // namespace
// Returns the list of the experimental features that are enabled or disabled,
// as part of currently running Safe Browsing experiments.
base::ListValue GetFeatureStatusList() {
base::ListValue param_list;
for (const auto& feature_status : kExperimentalFeatures) {
if (feature_status.probabilistically_enabled)
AddFeatureAndAvailability(feature_status.feature, ¶m_list);
}
return param_list;
}
} // namespace safe_browsing
|