File: features.cc

package info (click to toggle)
chromium 120.0.6099.224-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,112,112 kB
  • sloc: cpp: 32,907,025; ansic: 8,148,123; javascript: 3,679,536; python: 2,031,248; asm: 959,718; java: 804,675; xml: 617,256; sh: 111,417; objc: 100,835; perl: 88,443; cs: 53,032; makefile: 29,579; fortran: 24,137; php: 21,162; tcl: 21,147; sql: 20,809; ruby: 17,735; pascal: 12,864; yacc: 8,045; lisp: 3,388; lex: 1,323; ada: 727; awk: 329; jsp: 267; csh: 117; exp: 43; sed: 37
file content (162 lines) | stat: -rw-r--r-- 6,732 bytes parent folder | download
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
// 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 {

BASE_FEATURE(kRunOnMainThread,
             "RunOnMainThread",
             base::FEATURE_DISABLED_BY_DEFAULT);

BASE_FEATURE(kRunOnDedicatedThreadPoolThread,
             "RunOnDedicatedThreadPoolThread",
             base::FEATURE_DISABLED_BY_DEFAULT);

#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);

BASE_FEATURE(kPerformanceControlsHighEfficiencyOptOutSurvey,
             "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)};

BASE_FEATURE(kHighEfficiencyMultistateMode,
             "HighEfficiencyMultistateMode",
             base::FEATURE_DISABLED_BY_DEFAULT);
const base::FeatureParam<bool> kHighEfficiencyShowRecommendedBadge{
    &kHighEfficiencyMultistateMode, "show_recommended_badge", false};

BASE_FEATURE(kDiscardedTabTreatment,
             "DiscardedTabTreatment",
             base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kMemoryUsageInHovercards,
             "MemoryUsageInHovercards",
             base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kDiscardExceptionsImprovements,
             "DiscardExceptionsImprovements",
             base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kMemorySavingsReportingImprovements,
             "MemorySavingsReportingImprovements",
             base::FEATURE_DISABLED_BY_DEFAULT);

const base::FeatureParam<base::TimeDelta> kExpandedHighEfficiencyChipFrequency{
    &kMemorySavingsReportingImprovements,
    "expanded_high_efficiency_chip_frequency", base::Days(1)};

const base::FeatureParam<int> kExpandedHighEfficiencyChipThresholdBytes{
    &kMemorySavingsReportingImprovements,
    "expanded_high_efficiency_chip_threshold_bytes", 200 * 1024 * 1024};

const base::FeatureParam<base::TimeDelta>
    kExpandedHighEfficiencyChipDiscardedDuration{
        &kMemorySavingsReportingImprovements,
        "expanded_high_efficiency_chip_discarded_duration", base::Hours(6)};

const base::FeatureParam<int> kHighEfficiencyChartPmf25PercentileBytes{
    &kMemorySavingsReportingImprovements,
    "high_efficiency_chart_pmf_25_percentile_bytes", 62 * 1024 * 1024};
const base::FeatureParam<int> kHighEfficiencyChartPmf50PercentileBytes{
    &kMemorySavingsReportingImprovements,
    "high_efficiency_chart_pmf_50_percentile_bytes", 112 * 1024 * 1024};
const base::FeatureParam<int> kHighEfficiencyChartPmf75PercentileBytes{
    &kMemorySavingsReportingImprovements,
    "high_efficiency_chart_pmf_75_percentile_bytes", 197 * 1024 * 1024};
const base::FeatureParam<int> kHighEfficiencyChartPmf99PercentileBytes{
    &kMemorySavingsReportingImprovements,
    "high_efficiency_chart_pmf_99_percentile_bytes", 800 * 1024 * 1024};

const base::FeatureParam<double> kDiscardedTabTreatmentOpacity{
    &kDiscardedTabTreatment, "discard_tab_treatment_opacity", 0.5};

const base::FeatureParam<int> kDiscardedTabTreatmentOption{
    &kDiscardedTabTreatment, "discard_tab_treatment_option",
    static_cast<int>(DiscardTabTreatmentOptions::kFadeSmallFaviconWithRing)};

const base::FeatureParam<int> kMemoryUsageInHovercardsHighThresholdBytes{
    &kMemoryUsageInHovercards,
    "memory_usage_in_hovercards_high_threshold_bytes", 800 * 1024 * 1024};

// Mapping of enum value to parameter string for "memory_update_trigger" param.
constexpr base::FeatureParam<MemoryUsageInHovercardsUpdateTrigger>::Option
    kMemoryUsageInHovercardsUpdateTriggerOptions[] = {
        {MemoryUsageInHovercardsUpdateTrigger::kBackground, "background"},
        {MemoryUsageInHovercardsUpdateTrigger::kNavigation, "navigation"},
};

const base::FeatureParam<MemoryUsageInHovercardsUpdateTrigger>
    kMemoryUsageInHovercardsUpdateTrigger{
        &kMemoryUsageInHovercards, "memory_update_trigger",
        MemoryUsageInHovercardsUpdateTrigger::kBackground,
        &kMemoryUsageInHovercardsUpdateTriggerOptions};

BASE_FEATURE(kPerformanceControlsSidePanel,
             "PerformanceControlsSidePanel",
             base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_CHROMEOS_ASH)
BASE_FEATURE(kAshUrgentDiscardingFromPerformanceManager,
             "AshUrgentDiscardingFromPerformanceManager",
             base::FEATURE_DISABLED_BY_DEFAULT);
#endif  // BUILDFLAG(IS_CHROMEOS_ASH)

#endif

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

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

BASE_FEATURE(kPageTimelineMonitor,
             "PageTimelineMonitor",
             base::FEATURE_ENABLED_BY_DEFAULT);

const base::FeatureParam<base::TimeDelta> kPageTimelineStateIntervalTime{
    &kPageTimelineMonitor, "time_between_collect_slice", base::Minutes(5)};

const base::FeatureParam<bool> kUseResourceAttributionCPUMonitor{
    &kPageTimelineMonitor, "use_resource_attribution_cpu_monitor", false};

BASE_FEATURE(kCPUInterventionEvaluationLogging,
             "CPUInterventionEvaluationLogging",
             base::FEATURE_DISABLED_BY_DEFAULT);

const base::FeatureParam<base::TimeDelta> kDelayBeforeLogging{
    &kCPUInterventionEvaluationLogging, "delay_before_logging",
    base::Seconds(60)};

const base::FeatureParam<int> kThresholdChromeCPUPercent{
    &kCPUInterventionEvaluationLogging, "threshold_chrome_cpu_percent", 25};

}  // namespace performance_manager::features