File: features.cc

package info (click to toggle)
qt6-webengine 6.9.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 4,111,616 kB
  • sloc: cpp: 21,437,270; ansic: 8,087,114; javascript: 2,747,888; python: 856,615; asm: 848,149; xml: 616,344; java: 222,847; sh: 105,209; objc: 99,183; perl: 70,870; cs: 51,103; sql: 40,087; makefile: 26,376; pascal: 25,140; fortran: 24,137; tcl: 9,609; yacc: 8,132; php: 7,051; lisp: 3,462; lex: 1,327; ruby: 914; awk: 339; csh: 120; sed: 36
file content (171 lines) | stat: -rw-r--r-- 6,634 bytes parent folder | download | duplicates (2)
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This header contains field trial and variations definitions for policies,
// mechanisms and features in the performance_manager component.

#include "components/performance_manager/public/features.h"

#include "base/feature_list.h"
#include "base/metrics/field_trial_params.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"

namespace performance_manager::features {

#if BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(kRunOnMainThreadSync,
             "RunPerformanceManagerOnMainThreadSync",
             base::FEATURE_DISABLED_BY_DEFAULT);
#else
BASE_FEATURE(kRunOnMainThreadSync,
             "RunPerformanceManagerOnMainThreadSync",
              base::FEATURE_ENABLED_BY_DEFAULT);
#endif

#if !BUILDFLAG(IS_ANDROID)
BASE_FEATURE(kBackgroundTabLoadingFromPerformanceManager,
             "BackgroundTabLoadingFromPerformanceManager",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPerformanceControlsPerformanceSurvey,
             "PerformanceControlsPerformanceSurvey",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPerformanceControlsBatteryPerformanceSurvey,
             "PerformanceControlsBatteryPerformanceSurvey",
             base::FEATURE_DISABLED_BY_DEFAULT);

// The variable was renamed to "MemorySaver" but the experiment name remains as
// "HighEfficiency" because it is already running (crbug.com/1493843).
BASE_FEATURE(kPerformanceControlsMemorySaverOptOutSurvey,
             "PerformanceControlsHighEfficiencyOptOutSurvey",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPerformanceControlsBatterySaverOptOutSurvey,
             "PerformanceControlsBatterySaverOptOutSurvey",
             base::FEATURE_DISABLED_BY_DEFAULT);

const base::FeatureParam<base::TimeDelta>
    kPerformanceControlsBatterySurveyLookback{
        &kPerformanceControlsBatteryPerformanceSurvey, "battery_lookback",
        base::Days(8)};

#if BUILDFLAG(IS_WIN)
BASE_FEATURE(kPrefetchVirtualMemoryPolicy,
             "PrefetchVirtualMemoryPolicy",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif

BASE_FEATURE(kPerformanceIntervention,
             "PerformanceIntervention",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPerformanceInterventionUI,
             "PerformanceInterventionUI",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kPerformanceInterventionDemoMode,
             "PerformanceInterventionDemoMode",
             base::FEATURE_DISABLED_BY_DEFAULT);

bool ShouldUsePerformanceInterventionBackend() {
  return base::FeatureList::IsEnabled(kPerformanceIntervention) ||
         base::FeatureList::IsEnabled(kPerformanceInterventionUI);
}

const base::FeatureParam<int> kInterventionDialogStringVersion{
    &kPerformanceInterventionUI, "intervention_dialog_version", 1};

const base::FeatureParam<bool> kInterventionShowMixedProfileSuggestions{
    &kPerformanceInterventionUI, "intervention_show_mixed_profile", false};

const base::FeatureParam<base::TimeDelta> kInterventionButtonTimeout{
    &kPerformanceInterventionUI, "intervention_button_timeout",
    base::Seconds(10)};

const base::FeatureParam<base::TimeDelta> kCPUTimeOverThreshold{
    &kPerformanceIntervention, "cpu_time_over_threshold", base::Seconds(60)};
const base::FeatureParam<base::TimeDelta> kCPUSampleFrequency{
    &kPerformanceIntervention, "cpu_sample_frequency", base::Seconds(15)};

const base::FeatureParam<int> kCPUDegradedHealthPercentageThreshold{
    &kPerformanceIntervention, "cpu_degraded_percent_threshold", 50};
const base::FeatureParam<int> kCPUUnhealthyPercentageThreshold{
    &kPerformanceIntervention, "cpu_unhealthy_percent_threshold", 75};

const base::FeatureParam<int> kCPUMaxActionableTabs{
    &kPerformanceIntervention, "cpu_max_actionable_tabs", 4};

const base::FeatureParam<int> kMinimumActionableTabCPUPercentage{
    &kPerformanceIntervention, "minimum_actionable_tab_cpu", 10};

const base::FeatureParam<base::TimeDelta> kMemoryTimeOverThreshold{
    &kPerformanceIntervention, "memory_time_over_threshold", base::Seconds(60)};

const base::FeatureParam<int> kMemoryFreePercentThreshold{
    &kPerformanceIntervention, "memory_free_percent_threshold", 10};
const base::FeatureParam<int> kMemoryFreeBytesThreshold{
    &kPerformanceIntervention, "memory_free_bytes_threshold",
    1024 * 1024 * 1024};

#if BUILDFLAG(IS_CHROMEOS)
BASE_FEATURE(kUnthrottledTabProcessReporting,
             "UnthrottledTabProcessReporting",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_CHROMEOS)

#endif

BASE_FEATURE(kPMProcessPriorityPolicy,
             "PMProcessPriorityPolicy",
             base::FEATURE_DISABLED_BY_DEFAULT);

const base::FeatureParam<bool> kInheritParentPriority{
    &kPMProcessPriorityPolicy, "inherit_parent_priority", true};

const base::FeatureParam<bool> kDownvoteAdFrames{&kPMProcessPriorityPolicy,
                                                 "downvote_ad_frames", false};

BASE_FEATURE(kPMLoadingPageVoter,
             "PMLoadingPageVoter",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kBFCachePerformanceManagerPolicy,
             "BFCachePerformanceManagerPolicy",
             base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kUrgentPageDiscarding,
             "UrgentPageDiscarding",
             base::FEATURE_ENABLED_BY_DEFAULT);

BASE_FEATURE(kCPUMeasurementInFreezingPolicy,
             "CPUMeasurementInFreezingPolicy",
             base::FEATURE_DISABLED_BY_DEFAULT);

// Note: This param is associated with `kCPUMeasurementInFreezingPolicy` instead
// of `kFreezingOnBatterySaver`, to allow retrieving the value without
// activating the `kFreezingOnBatterySaver` feature.
const base::FeatureParam<double> kFreezingOnBatterySaverHighCPUProportion{
    &kCPUMeasurementInFreezingPolicy,
    "freezing_on_battery_saver_high_cpu_proportion", 0.25};

BASE_FEATURE(kFreezingOnBatterySaver,
             "FreezingOnBatterySaver",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kFreezingOnBatterySaverForTesting,
             "FreezingOnBatterySaverForTesting",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kResourceAttributionIncludeOrigins,
             "ResourceAttributionIncludeOrigins",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kSeamlessRenderFrameSwap,
             "SeamlessRenderFrameSwap",
             base::FEATURE_DISABLED_BY_DEFAULT);

}  // namespace performance_manager::features