Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 175 'text/html': {'document': true}, | 175 'text/html': {'document': true}, |
| 176 'text/xml': {'document': true}, | 176 'text/xml': {'document': true}, |
| 177 'text/plain': {'document': true}, | 177 'text/plain': {'document': true}, |
| 178 'application/xhtml+xml': {'document': true}, | 178 'application/xhtml+xml': {'document': true}, |
| 179 'image/svg+xml': {'document': true}, | 179 'image/svg+xml': {'document': true}, |
| 180 'text/css': {'stylesheet': true}, | 180 'text/css': {'stylesheet': true}, |
| 181 'text/xsl': {'stylesheet': true}, | 181 'text/xsl': {'stylesheet': true}, |
| 182 'text/vtt': {'texttrack': true}, | 182 'text/vtt': {'texttrack': true}, |
| 183 }; | 183 }; |
| 184 | 184 |
| 185 /** | |
| 186 * @typedef {{ | |
| 187 * download: number, | |
| 188 * upload: number, | |
| 189 * latency: number, | |
| 190 * title: string, | |
| 191 * description: (string | undefined) | |
| 192 * }} | |
| 193 **/ | |
| 194 SDK.NetworkManager.Conditions; | |
| 185 | 195 |
| 186 /** @typedef {{download: number, upload: number, latency: number, title: string} } */ | |
| 187 SDK.NetworkManager.Conditions; | |
| 188 /** @type {!SDK.NetworkManager.Conditions} */ | 196 /** @type {!SDK.NetworkManager.Conditions} */ |
| 189 SDK.NetworkManager.NoThrottlingConditions = { | 197 SDK.NetworkManager.NoThrottlingConditions = { |
| 190 title: Common.UIString('No throttling'), | 198 title: Common.UIString('Online'), |
| 191 download: -1, | 199 download: -1, |
| 192 upload: -1, | 200 upload: -1, |
| 193 latency: 0 | 201 latency: 0 |
| 194 }; | 202 }; |
| 203 | |
| 195 /** @type {!SDK.NetworkManager.Conditions} */ | 204 /** @type {!SDK.NetworkManager.Conditions} */ |
| 196 SDK.NetworkManager.OfflineConditions = { | 205 SDK.NetworkManager.OfflineConditions = { |
| 197 title: Common.UIString('Offline'), | 206 title: Common.UIString('Offline'), |
| 198 download: 0, | 207 download: 0, |
| 199 upload: 0, | 208 upload: 0, |
| 200 latency: 0 | 209 latency: 0, |
| 210 description: Common.UIString('No internet connectivity') | |
| 201 }; | 211 }; |
| 212 | |
| 213 /** @type {!SDK.NetworkManager.Conditions} */ | |
| 214 SDK.NetworkManager.LieFiMobileConditions = { | |
|
dgozman
2017/06/28 22:33:09
Put LieFi into a separate patch (so it's easy to r
chenwilliam
2017/06/29 20:34:02
haha ok. Done.
| |
| 215 title: Common.UIString('LieFi'), | |
| 216 download: 100 * 1024 * 1024 / 8, | |
| 217 upload: 100 * 1024 * 1024 / 8, | |
| 218 latency: 60000, | |
| 219 description: Common.UIString('Connected to WiFi but no internet connectivity') | |
| 220 }; | |
| 221 | |
| 222 /** @type {!SDK.NetworkManager.Conditions} */ | |
| 223 SDK.NetworkManager.Slow3GConditions = { | |
| 224 title: Common.UIString('Slow 3G'), | |
| 225 download: 500 * 1024 / 8 * .8, | |
| 226 upload: 500 * 1024 / 8 * .8, | |
| 227 latency: 400 * 5, | |
| 228 }; | |
| 229 | |
| 230 /** @type {!SDK.NetworkManager.Conditions} */ | |
| 231 SDK.NetworkManager.Fast3GConditions = { | |
| 232 title: Common.UIString('Fast 3G'), | |
| 233 download: 1.6 * 1024 * 1024 / 8 * .9, | |
| 234 upload: 750 * 1024 / 8 * .9, | |
| 235 latency: 150 * 3.75, | |
| 236 }; | |
| 237 | |
| 202 /** @typedef {{url: string, enabled: boolean}} */ | 238 /** @typedef {{url: string, enabled: boolean}} */ |
| 203 SDK.NetworkManager.BlockedPattern; | 239 SDK.NetworkManager.BlockedPattern; |
| 204 | 240 |
| 205 SDK.NetworkManager._networkManagerForRequestSymbol = Symbol('NetworkManager'); | 241 SDK.NetworkManager._networkManagerForRequestSymbol = Symbol('NetworkManager'); |
| 206 | 242 |
| 207 /** | 243 /** |
| 208 * @implements {Protocol.NetworkDispatcher} | 244 * @implements {Protocol.NetworkDispatcher} |
| 209 * @unrestricted | 245 * @unrestricted |
| 210 */ | 246 */ |
| 211 SDK.NetworkDispatcher = class { | 247 SDK.NetworkDispatcher = class { |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 976 SDK.MultitargetNetworkManager.Events = { | 1012 SDK.MultitargetNetworkManager.Events = { |
| 977 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), | 1013 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), |
| 978 ConditionsChanged: Symbol('ConditionsChanged'), | 1014 ConditionsChanged: Symbol('ConditionsChanged'), |
| 979 UserAgentChanged: Symbol('UserAgentChanged') | 1015 UserAgentChanged: Symbol('UserAgentChanged') |
| 980 }; | 1016 }; |
| 981 | 1017 |
| 982 /** | 1018 /** |
| 983 * @type {!SDK.MultitargetNetworkManager} | 1019 * @type {!SDK.MultitargetNetworkManager} |
| 984 */ | 1020 */ |
| 985 SDK.multitargetNetworkManager; | 1021 SDK.multitargetNetworkManager; |
| OLD | NEW |