Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_H _ | 5 #ifndef COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_H _ |
| 6 #define COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_H _ | 6 #define COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURES_H _ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 #include <memory> | |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/feature_list.h" | 12 #include "base/feature_list.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
| 15 #include "components/subresource_filter/core/common/activation_level.h" | 16 #include "components/subresource_filter/core/common/activation_level.h" |
| 16 #include "components/subresource_filter/core/common/activation_list.h" | 17 #include "components/subresource_filter/core/common/activation_list.h" |
| 17 #include "components/subresource_filter/core/common/activation_scope.h" | 18 #include "components/subresource_filter/core/common/activation_scope.h" |
| 18 | 19 |
| 20 namespace base { | |
| 21 namespace trace_event { | |
| 22 class TracedValue; | |
| 23 } // namespace trace_event | |
| 24 } // namespace base | |
| 25 | |
| 19 namespace subresource_filter { | 26 namespace subresource_filter { |
| 20 | 27 |
| 21 // Encapsulates a set of parameters that define how the subresource filter | 28 // Encapsulates a set of parameters that define how the subresource filter |
| 22 // feature should operate. Each configuration consists of three parts as | 29 // feature should operate. Each configuration consists of three parts as |
| 23 // described in detail below. | 30 // described in detail below. |
| 24 // | 31 // |
| 25 // There can be multiple configuration enabled at the same time. For each | 32 // There can be multiple configuration enabled at the same time. For each |
| 26 // navigation, however, subresource filtering will be activated according to | 33 // navigation, however, subresource filtering will be activated according to |
| 27 // exactly one of these enabled configuration, if any. Namely, the configuration | 34 // exactly one of these enabled configuration, if any. Namely, the configuration |
| 28 // with the highest |priority| among those whose |activation_conditions| are | 35 // with the highest |priority| among those whose |activation_conditions| are |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 ActivationList activation_list = ActivationList::NONE); | 102 ActivationList activation_list = ActivationList::NONE); |
| 96 Configuration(const Configuration&); | 103 Configuration(const Configuration&); |
| 97 Configuration(Configuration&&); | 104 Configuration(Configuration&&); |
| 98 ~Configuration(); | 105 ~Configuration(); |
| 99 Configuration& operator=(const Configuration&); | 106 Configuration& operator=(const Configuration&); |
| 100 Configuration& operator=(Configuration&&); | 107 Configuration& operator=(Configuration&&); |
| 101 | 108 |
| 102 bool operator==(const Configuration& rhs) const; | 109 bool operator==(const Configuration& rhs) const; |
| 103 bool operator!=(const Configuration& rhs) const; | 110 bool operator!=(const Configuration& rhs) const; |
| 104 | 111 |
| 112 std::unique_ptr<base::trace_event::TracedValue> GetTracedValue() const; | |
|
engedy
2017/05/15 12:10:38
nit: {As|To}TracedValue
Charlie Harrison
2017/05/15 15:14:22
Renamed ToTracedValue.
| |
| 113 | |
| 105 // Factory methods for preset configurations. | 114 // Factory methods for preset configurations. |
| 106 // | 115 // |
| 107 // To add a new preset: | 116 // To add a new preset: |
| 108 // 1.) Define a named factory method here. | 117 // 1.) Define a named factory method here. |
| 109 // 2.) Define a name for the configuration to be used in variation params. | 118 // 2.) Define a name for the configuration to be used in variation params. |
| 110 // 3.) Register it into |kAvailablePresetConfigurations| in the .cc file. | 119 // 3.) Register it into |kAvailablePresetConfigurations| in the .cc file. |
| 111 // 4.) Update unittests to cover the new preset. | 120 // 4.) Update unittests to cover the new preset. |
| 112 static Configuration MakePresetForLiveRunOnPhishingSites(); | 121 static Configuration MakePresetForLiveRunOnPhishingSites(); |
| 113 static Configuration MakePresetForPerformanceTestingDryRunOnAllSites(); | 122 static Configuration MakePresetForPerformanceTestingDryRunOnAllSites(); |
| 114 | 123 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 extern const char kRulesetFlavorParameterName[]; | 208 extern const char kRulesetFlavorParameterName[]; |
| 200 | 209 |
| 201 extern const char kEnablePresetsParameterName[]; | 210 extern const char kEnablePresetsParameterName[]; |
| 202 extern const char kDisablePresetsParameterName[]; | 211 extern const char kDisablePresetsParameterName[]; |
| 203 extern const char kPresetLiveRunOnPhishingSites[]; | 212 extern const char kPresetLiveRunOnPhishingSites[]; |
| 204 extern const char kPresetPerformanceTestingDryRunOnAllSites[]; | 213 extern const char kPresetPerformanceTestingDryRunOnAllSites[]; |
| 205 | 214 |
| 206 } // namespace subresource_filter | 215 } // namespace subresource_filter |
| 207 | 216 |
| 208 #endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURE S_H_ | 217 #endif // COMPONENTS_SUBRESOURCE_FILTER_CORE_BROWSER_SUBRESOURCE_FILTER_FEATURE S_H_ |
| OLD | NEW |