| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 /** @enum {number} */ |
| 6 MobileThrottling.CPUThrottlingRates = { |
| 7 NoThrottling: 1, |
| 8 MidTierMobile: 4, |
| 9 LowEndMobile: 6, |
| 10 }; |
| 11 |
| 12 /** |
| 13 * @typedef {{ |
| 14 * title: string, |
| 15 * description: string, |
| 16 * network: !SDK.NetworkManager.Conditions, |
| 17 * cpuThrottlingRate: !MobileThrottling.CPUThrottlingRates |
| 18 * }} |
| 19 **/ |
| 20 MobileThrottling.Conditions; |
| 21 |
| 22 /** @type {!MobileThrottling.Conditions} */ |
| 23 MobileThrottling.NoThrottlingConditions = { |
| 24 title: SDK.NetworkManager.NoThrottlingConditions.title, |
| 25 description: Common.UIString('No throttling'), |
| 26 network: SDK.NetworkManager.NoThrottlingConditions, |
| 27 cpuThrottlingRate: MobileThrottling.CPUThrottlingRates.NoThrottling, |
| 28 }; |
| 29 |
| 30 /** @type {!MobileThrottling.Conditions} */ |
| 31 MobileThrottling.OfflineConditions = { |
| 32 title: SDK.NetworkManager.OfflineConditions.title, |
| 33 description: Common.UIString('No internet connectivity'), |
| 34 network: SDK.NetworkManager.OfflineConditions, |
| 35 cpuThrottlingRate: MobileThrottling.CPUThrottlingRates.NoThrottling, |
| 36 }; |
| 37 |
| 38 /** @type {!MobileThrottling.Conditions} */ |
| 39 MobileThrottling.LowEndMobileConditions = { |
| 40 title: Common.UIString('Low-end mobile'), |
| 41 description: Common.UIString('Slow 3G & 6x CPU slowdown'), |
| 42 network: SDK.NetworkManager.Slow3GConditions, |
| 43 cpuThrottlingRate: MobileThrottling.CPUThrottlingRates.LowEndMobile, |
| 44 }; |
| 45 |
| 46 /** @type {!MobileThrottling.Conditions} */ |
| 47 MobileThrottling.MidTierMobileConditions = { |
| 48 title: Common.UIString('Mid-tier mobile'), |
| 49 description: Common.UIString('Fast 3G & 4x CPU slowdown'), |
| 50 network: SDK.NetworkManager.Fast3GConditions, |
| 51 cpuThrottlingRate: MobileThrottling.CPUThrottlingRates.MidTierMobile, |
| 52 }; |
| 53 |
| 54 /** |
| 55 * @typedef {{ |
| 56 * title: string, |
| 57 * description: string |
| 58 * }} |
| 59 **/ |
| 60 MobileThrottling.PlaceholderConditions; |
| 61 |
| 62 /** @type {!MobileThrottling.PlaceholderConditions} */ |
| 63 MobileThrottling.CustomConditions = { |
| 64 title: Common.UIString('Custom'), |
| 65 description: Common.UIString('Check Network and Performance panels'), |
| 66 }; |
| 67 |
| 68 /** @typedef {!{title: string, items: !Array<!SDK.NetworkManager.Conditions>}} *
/ |
| 69 MobileThrottling.NetworkThrottlingConditionsGroup; |
| 70 |
| 71 /** @typedef {!{title: string, items: !Array<!MobileThrottling.Conditions|!Mobil
eThrottling.PlaceholderConditions>}} */ |
| 72 MobileThrottling.MobileThrottlingConditionsGroup; |
| 73 |
| 74 /** @typedef {!Array<?MobileThrottling.Conditions|!MobileThrottling.PlaceholderC
onditions>} */ |
| 75 MobileThrottling.ConditionsList; |
| 76 |
| 77 /** @type {!Array.<!MobileThrottling.Conditions>} */ |
| 78 MobileThrottling.mobilePresets = [ |
| 79 MobileThrottling.MidTierMobileConditions, MobileThrottling.LowEndMobileConditi
ons, MobileThrottling.CustomConditions |
| 80 ]; |
| 81 |
| 82 /** @type {!Array.<!MobileThrottling.Conditions>} */ |
| 83 MobileThrottling.advancedMobilePresets = [ |
| 84 MobileThrottling.OfflineConditions, |
| 85 ]; |
| 86 |
| 87 /** @type {!Array<!SDK.NetworkManager.Conditions>} */ |
| 88 MobileThrottling.networkPresets = [ |
| 89 SDK.NetworkManager.Fast3GConditions, |
| 90 SDK.NetworkManager.Slow3GConditions, |
| 91 SDK.NetworkManager.OfflineConditions, |
| 92 ]; |
| 93 |
| 94 /** @type {!Array<!MobileThrottling.CPUThrottlingRates>} */ |
| 95 MobileThrottling.cpuThrottlingPresets = [ |
| 96 MobileThrottling.CPUThrottlingRates.NoThrottling, |
| 97 MobileThrottling.CPUThrottlingRates.MidTierMobile, |
| 98 MobileThrottling.CPUThrottlingRates.LowEndMobile, |
| 99 ]; |
| OLD | NEW |