| 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 * }} |
| 192 **/ |
| 193 SDK.NetworkManager.Conditions; |
| 185 | 194 |
| 186 /** @typedef {{download: number, upload: number, latency: number, title: string}
} */ | |
| 187 SDK.NetworkManager.Conditions; | |
| 188 /** @type {!SDK.NetworkManager.Conditions} */ | 195 /** @type {!SDK.NetworkManager.Conditions} */ |
| 189 SDK.NetworkManager.NoThrottlingConditions = { | 196 SDK.NetworkManager.NoThrottlingConditions = { |
| 190 title: Common.UIString('No throttling'), | 197 title: Common.UIString('Online'), |
| 191 download: -1, | 198 download: -1, |
| 192 upload: -1, | 199 upload: -1, |
| 193 latency: 0 | 200 latency: 0 |
| 194 }; | 201 }; |
| 202 |
| 195 /** @type {!SDK.NetworkManager.Conditions} */ | 203 /** @type {!SDK.NetworkManager.Conditions} */ |
| 196 SDK.NetworkManager.OfflineConditions = { | 204 SDK.NetworkManager.OfflineConditions = { |
| 197 title: Common.UIString('Offline'), | 205 title: Common.UIString('Offline'), |
| 198 download: 0, | 206 download: 0, |
| 199 upload: 0, | 207 upload: 0, |
| 200 latency: 0 | 208 latency: 0, |
| 201 }; | 209 }; |
| 210 |
| 211 /** @type {!SDK.NetworkManager.Conditions} */ |
| 212 SDK.NetworkManager.Slow3GConditions = { |
| 213 title: Common.UIString('Slow 3G'), |
| 214 download: 500 * 1024 / 8 * .8, |
| 215 upload: 500 * 1024 / 8 * .8, |
| 216 latency: 400 * 5, |
| 217 }; |
| 218 |
| 219 /** @type {!SDK.NetworkManager.Conditions} */ |
| 220 SDK.NetworkManager.Fast3GConditions = { |
| 221 title: Common.UIString('Fast 3G'), |
| 222 download: 1.6 * 1024 * 1024 / 8 * .9, |
| 223 upload: 750 * 1024 / 8 * .9, |
| 224 latency: 150 * 3.75, |
| 225 }; |
| 226 |
| 202 /** @typedef {{url: string, enabled: boolean}} */ | 227 /** @typedef {{url: string, enabled: boolean}} */ |
| 203 SDK.NetworkManager.BlockedPattern; | 228 SDK.NetworkManager.BlockedPattern; |
| 204 | 229 |
| 205 SDK.NetworkManager._networkManagerForRequestSymbol = Symbol('NetworkManager'); | 230 SDK.NetworkManager._networkManagerForRequestSymbol = Symbol('NetworkManager'); |
| 206 | 231 |
| 207 /** | 232 /** |
| 208 * @implements {Protocol.NetworkDispatcher} | 233 * @implements {Protocol.NetworkDispatcher} |
| 209 * @unrestricted | 234 * @unrestricted |
| 210 */ | 235 */ |
| 211 SDK.NetworkDispatcher = class { | 236 SDK.NetworkDispatcher = class { |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 SDK.MultitargetNetworkManager.Events = { | 993 SDK.MultitargetNetworkManager.Events = { |
| 969 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), | 994 BlockedPatternsChanged: Symbol('BlockedPatternsChanged'), |
| 970 ConditionsChanged: Symbol('ConditionsChanged'), | 995 ConditionsChanged: Symbol('ConditionsChanged'), |
| 971 UserAgentChanged: Symbol('UserAgentChanged') | 996 UserAgentChanged: Symbol('UserAgentChanged') |
| 972 }; | 997 }; |
| 973 | 998 |
| 974 /** | 999 /** |
| 975 * @type {!SDK.MultitargetNetworkManager} | 1000 * @type {!SDK.MultitargetNetworkManager} |
| 976 */ | 1001 */ |
| 977 SDK.multitargetNetworkManager; | 1002 SDK.multitargetNetworkManager; |
| OLD | NEW |