| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 this._bypassServiceWorkerSetting = Common.settings.createSetting('bypassServ
iceWorker', false); | 54 this._bypassServiceWorkerSetting = Common.settings.createSetting('bypassServ
iceWorker', false); |
| 55 if (this._bypassServiceWorkerSetting.get()) | 55 if (this._bypassServiceWorkerSetting.get()) |
| 56 this._bypassServiceWorkerChanged(); | 56 this._bypassServiceWorkerChanged(); |
| 57 this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorker
Changed, this); | 57 this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorker
Changed, this); |
| 58 | 58 |
| 59 Common.moduleSetting('cacheDisabled').addChangeListener(this._cacheDisabledS
ettingChanged, this); | 59 Common.moduleSetting('cacheDisabled').addChangeListener(this._cacheDisabledS
ettingChanged, this); |
| 60 } | 60 } |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * @param {!SDK.Target} target | |
| 64 * @return {?SDK.NetworkManager} | |
| 65 */ | |
| 66 static fromTarget(target) { | |
| 67 return target.model(SDK.NetworkManager); | |
| 68 } | |
| 69 | |
| 70 /** | |
| 71 * @param {!SDK.NetworkManager.Conditions} conditions | 63 * @param {!SDK.NetworkManager.Conditions} conditions |
| 72 * @return {!Protocol.Network.ConnectionType} | 64 * @return {!Protocol.Network.ConnectionType} |
| 73 * TODO(allada): this belongs to NetworkConditionsSelector, which should hardc
ode/guess it. | 65 * TODO(allada): this belongs to NetworkConditionsSelector, which should hardc
ode/guess it. |
| 74 */ | 66 */ |
| 75 static _connectionType(conditions) { | 67 static _connectionType(conditions) { |
| 76 if (!conditions.download && !conditions.upload) | 68 if (!conditions.download && !conditions.upload) |
| 77 return Protocol.Network.ConnectionType.None; | 69 return Protocol.Network.ConnectionType.None; |
| 78 var types = SDK.NetworkManager._connectionTypes; | 70 var types = SDK.NetworkManager._connectionTypes; |
| 79 if (!types) { | 71 if (!types) { |
| 80 SDK.NetworkManager._connectionTypes = []; | 72 SDK.NetworkManager._connectionTypes = []; |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 /** @enum {symbol} */ | 865 /** @enum {symbol} */ |
| 874 SDK.MultitargetNetworkManager.Events = { | 866 SDK.MultitargetNetworkManager.Events = { |
| 875 ConditionsChanged: Symbol('ConditionsChanged'), | 867 ConditionsChanged: Symbol('ConditionsChanged'), |
| 876 UserAgentChanged: Symbol('UserAgentChanged') | 868 UserAgentChanged: Symbol('UserAgentChanged') |
| 877 }; | 869 }; |
| 878 | 870 |
| 879 /** | 871 /** |
| 880 * @type {!SDK.MultitargetNetworkManager} | 872 * @type {!SDK.MultitargetNetworkManager} |
| 881 */ | 873 */ |
| 882 SDK.multitargetNetworkManager; | 874 SDK.multitargetNetworkManager; |
| OLD | NEW |