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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 | 53 |
| 54 /** @type {!Map<!SecurityAgent.CertificateId, !Promise<!NetworkAgent.Certifi cateDetails>>} */ | 54 /** @type {!Map<!SecurityAgent.CertificateId, !Promise<!NetworkAgent.Certifi cateDetails>>} */ |
| 55 this._certificateDetailsCache = new Map(); | 55 this._certificateDetailsCache = new Map(); |
| 56 | 56 |
| 57 this._bypassServiceWorkerSetting = WebInspector.settings.createSetting("bypa ssServiceWorker", false); | 57 this._bypassServiceWorkerSetting = WebInspector.settings.createSetting("bypa ssServiceWorker", false); |
| 58 if (this._bypassServiceWorkerSetting.get()) | 58 if (this._bypassServiceWorkerSetting.get()) |
| 59 this._bypassServiceWorkerChanged(); | 59 this._bypassServiceWorkerChanged(); |
| 60 this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorker Changed, this); | 60 this._bypassServiceWorkerSetting.addChangeListener(this._bypassServiceWorker Changed, this); |
| 61 | 61 |
| 62 WebInspector.moduleSetting("cacheDisabled").addChangeListener(this._cacheDis abledSettingChanged, this); | 62 WebInspector.moduleSetting("cacheDisabled").addChangeListener(this._cacheDis abledSettingChanged, this); |
| 63 | |
| 64 console.assert(!target[WebInspector.NetworkManager._symbol]); | |
| 65 target[WebInspector.NetworkManager._symbol] = this; | |
| 66 console.assert(this.dispose); | |
|
dgozman
2016/06/29 18:37:58
Why this check? We have dispose declared in this f
eostroukhov-old
2016/06/29 22:54:20
Oops :) Debugging artifact.
| |
| 67 target.disposables.push(this); | |
| 63 } | 68 } |
| 64 | 69 |
| 65 WebInspector.NetworkManager.EventTypes = { | 70 WebInspector.NetworkManager.EventTypes = { |
| 66 RequestStarted: "RequestStarted", | 71 RequestStarted: "RequestStarted", |
| 67 RequestUpdated: "RequestUpdated", | 72 RequestUpdated: "RequestUpdated", |
| 68 RequestFinished: "RequestFinished", | 73 RequestFinished: "RequestFinished", |
| 69 RequestUpdateDropped: "RequestUpdateDropped", | 74 RequestUpdateDropped: "RequestUpdateDropped", |
| 70 ResponseReceived: "ResponseReceived" | 75 ResponseReceived: "ResponseReceived" |
| 71 } | 76 } |
| 72 | 77 |
| 73 WebInspector.NetworkManager._MIMETypes = { | 78 WebInspector.NetworkManager._MIMETypes = { |
| 74 "text/html": {"document": true}, | 79 "text/html": {"document": true}, |
| 75 "text/xml": {"document": true}, | 80 "text/xml": {"document": true}, |
| 76 "text/plain": {"document": true}, | 81 "text/plain": {"document": true}, |
| 77 "application/xhtml+xml": {"document": true}, | 82 "application/xhtml+xml": {"document": true}, |
| 78 "image/svg+xml": {"document": true}, | 83 "image/svg+xml": {"document": true}, |
| 79 "text/css": {"stylesheet": true}, | 84 "text/css": {"stylesheet": true}, |
| 80 "text/xsl": {"stylesheet": true}, | 85 "text/xsl": {"stylesheet": true}, |
| 81 "text/vtt": {"texttrack": true}, | 86 "text/vtt": {"texttrack": true}, |
| 82 } | 87 } |
| 83 | 88 |
| 89 WebInspector.NetworkManager._symbol = Symbol("NetworkManager"); | |
| 90 | |
| 91 /** | |
| 92 * @param {!WebInspector.Target} target | |
| 93 * @return {?WebInspector.NetworkManager} | |
| 94 */ | |
| 95 WebInspector.NetworkManager.fromTarget = function(target) { | |
|
dgozman
2016/06/29 18:37:58
style: { on next line
Doesn't eslint in presubmit
eostroukhov-old
2016/06/29 22:54:20
Done.
I have not seen any linter warnings...
| |
| 96 console.assert(target); | |
| 97 return target[WebInspector.NetworkManager._symbol] || null; | |
| 98 } | |
| 99 | |
| 84 /** @typedef {{download: number, upload: number, latency: number, title: string} } */ | 100 /** @typedef {{download: number, upload: number, latency: number, title: string} } */ |
| 85 WebInspector.NetworkManager.Conditions; | 101 WebInspector.NetworkManager.Conditions; |
| 86 /** @type {!WebInspector.NetworkManager.Conditions} */ | 102 /** @type {!WebInspector.NetworkManager.Conditions} */ |
| 87 WebInspector.NetworkManager.NoThrottlingConditions = {title: WebInspector.UIStri ng("No throttling"), download: -1, upload: -1, latency: 0}; | 103 WebInspector.NetworkManager.NoThrottlingConditions = {title: WebInspector.UIStri ng("No throttling"), download: -1, upload: -1, latency: 0}; |
| 88 /** @type {!WebInspector.NetworkManager.Conditions} */ | 104 /** @type {!WebInspector.NetworkManager.Conditions} */ |
| 89 WebInspector.NetworkManager.OfflineConditions = {title: WebInspector.UIString("O ffline"), download: 0, upload: 0, latency: 0}; | 105 WebInspector.NetworkManager.OfflineConditions = {title: WebInspector.UIString("O ffline"), download: 0, upload: 0, latency: 0}; |
| 90 | 106 |
| 91 WebInspector.NetworkManager.prototype = { | 107 WebInspector.NetworkManager.prototype = { |
| 92 /** | 108 /** |
| 93 * @param {string} url | 109 * @param {string} url |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 907 WebInspector.ResourceLoader.load(url, headers, callback); | 923 WebInspector.ResourceLoader.load(url, headers, callback); |
| 908 }, | 924 }, |
| 909 | 925 |
| 910 __proto__: WebInspector.Object.prototype | 926 __proto__: WebInspector.Object.prototype |
| 911 } | 927 } |
| 912 | 928 |
| 913 /** | 929 /** |
| 914 * @type {!WebInspector.MultitargetNetworkManager} | 930 * @type {!WebInspector.MultitargetNetworkManager} |
| 915 */ | 931 */ |
| 916 WebInspector.multitargetNetworkManager; | 932 WebInspector.multitargetNetworkManager; |
| OLD | NEW |