Chris Hamilton | afe2a4c | 2020-05-13 14:16:08 | [diff] [blame] | 1 | // Copyright 2020 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | // This header contains field trial and variations definitions for policies, |
| 6 | // mechanisms and features in the performance_manager component. |
| 7 | |
| 8 | #include "components/performance_manager/public/features.h" |
| 9 | |
| 10 | #include "base/metrics/field_trial_params.h" |
| 11 | |
| 12 | namespace performance_manager { |
| 13 | namespace features { |
| 14 | |
| 15 | const base::Feature kTabLoadingFrameNavigationThrottles{ |
| 16 | "TabLoadingFrameNavigationThrottles", base::FEATURE_DISABLED_BY_DEFAULT}; |
| 17 | |
| 18 | // Parameters associated with the "TabLoadingFrameNavigationThrottles" |
| 19 | // feature. |
| 20 | const base::FeatureParam<int> kMinimumThrottleTimeoutMilliseconds = { |
| 21 | &kTabLoadingFrameNavigationThrottles, "MinimumThrottleTimeoutMilliseconds", |
| 22 | 1000}; |
| 23 | // This defaults to the 99th %ile of LargestContentfulPaint (LCP). |
| 24 | const base::FeatureParam<int> kMaximumThrottleTimeoutMilliseconds = { |
| 25 | &kTabLoadingFrameNavigationThrottles, "MaximumThrottleTimeoutMilliseconds", |
| 26 | 40000}; |
Chris Hamilton | ffd840b | 2020-05-21 14:12:04 | [diff] [blame] | 27 | // This defaults to 3 since 3 * 99th%ile FCP ~= 99th%ile LCP. |
| 28 | const base::FeatureParam<double> kFCPMultiple = { |
| 29 | &kTabLoadingFrameNavigationThrottles, "FCPMultiple", 3.0}; |
Chris Hamilton | afe2a4c | 2020-05-13 14:16:08 | [diff] [blame] | 30 | |
| 31 | TabLoadingFrameNavigationThrottlesParams:: |
| 32 | TabLoadingFrameNavigationThrottlesParams() = default; |
| 33 | |
| 34 | TabLoadingFrameNavigationThrottlesParams:: |
| 35 | ~TabLoadingFrameNavigationThrottlesParams() = default; |
| 36 | |
| 37 | // static |
| 38 | TabLoadingFrameNavigationThrottlesParams |
| 39 | TabLoadingFrameNavigationThrottlesParams::GetParams() { |
| 40 | TabLoadingFrameNavigationThrottlesParams params; |
| 41 | params.minimum_throttle_timeout = base::TimeDelta::FromMilliseconds( |
| 42 | kMinimumThrottleTimeoutMilliseconds.Get()); |
| 43 | params.maximum_throttle_timeout = base::TimeDelta::FromMilliseconds( |
| 44 | kMaximumThrottleTimeoutMilliseconds.Get()); |
Chris Hamilton | ffd840b | 2020-05-21 14:12:04 | [diff] [blame] | 45 | params.fcp_multiple = kFCPMultiple.Get(); |
Chris Hamilton | afe2a4c | 2020-05-13 14:16:08 | [diff] [blame] | 46 | return params; |
| 47 | } |
| 48 | |
| 49 | } // namespace features |
| 50 | } // namespace performance_manager |