| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 NetworkAgent.enable(); | 42 NetworkAgent.enable(); |
| 43 | 43 |
| 44 WebInspector.settings.cacheDisabled.addChangeListener(this._cacheDisabledSet
tingChanged, this); | 44 WebInspector.settings.cacheDisabled.addChangeListener(this._cacheDisabledSet
tingChanged, this); |
| 45 | 45 |
| 46 if (WebInspector.settings.userAgent.get()) | 46 if (WebInspector.settings.userAgent.get()) |
| 47 this._userAgentSettingChanged(); | 47 this._userAgentSettingChanged(); |
| 48 WebInspector.settings.userAgent.addChangeListener(this._userAgentSettingChan
ged, this); | 48 WebInspector.settings.userAgent.addChangeListener(this._userAgentSettingChan
ged, this); |
| 49 } | 49 } |
| 50 | 50 |
| 51 WebInspector.NetworkManager.EventTypes = { | 51 WebInspector.NetworkManager.EventTypes = { |
| 52 ResourceTrackingEnabled: "ResourceTrackingEnabled", |
| 53 ResourceTrackingDisabled: "ResourceTrackingDisabled", |
| 52 RequestStarted: "RequestStarted", | 54 RequestStarted: "RequestStarted", |
| 53 RequestUpdated: "RequestUpdated", | 55 RequestUpdated: "RequestUpdated", |
| 54 RequestFinished: "RequestFinished", | 56 RequestFinished: "RequestFinished", |
| 55 RequestUpdateDropped: "RequestUpdateDropped" | 57 RequestUpdateDropped: "RequestUpdateDropped" |
| 56 } | 58 } |
| 57 | 59 |
| 58 WebInspector.NetworkManager._MIMETypes = { | 60 WebInspector.NetworkManager._MIMETypes = { |
| 59 "text/html": {"document": true}, | 61 "text/html": {"document": true}, |
| 60 "text/xml": {"document": true}, | 62 "text/xml": {"document": true}, |
| 61 "text/plain": {"document": true}, | 63 "text/plain": {"document": true}, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 85 "application/x-javascript": {"script": true}, | 87 "application/x-javascript": {"script": true}, |
| 86 "application/json": {"script": true}, | 88 "application/json": {"script": true}, |
| 87 "text/javascript1.1": {"script": true}, | 89 "text/javascript1.1": {"script": true}, |
| 88 "text/javascript1.2": {"script": true}, | 90 "text/javascript1.2": {"script": true}, |
| 89 "text/javascript1.3": {"script": true}, | 91 "text/javascript1.3": {"script": true}, |
| 90 "text/jscript": {"script": true}, | 92 "text/jscript": {"script": true}, |
| 91 "text/livescript": {"script": true}, | 93 "text/livescript": {"script": true}, |
| 92 } | 94 } |
| 93 | 95 |
| 94 WebInspector.NetworkManager.prototype = { | 96 WebInspector.NetworkManager.prototype = { |
| 97 enableResourceTracking: function() |
| 98 { |
| 99 function callback(error) |
| 100 { |
| 101 this.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes
.ResourceTrackingEnabled); |
| 102 } |
| 103 NetworkAgent.enable(callback.bind(this)); |
| 104 }, |
| 105 |
| 106 disableResourceTracking: function() |
| 107 { |
| 108 function callback(error) |
| 109 { |
| 110 this.dispatchEventToListeners(WebInspector.NetworkManager.EventTypes
.ResourceTrackingDisabled); |
| 111 } |
| 112 NetworkAgent.disable(callback.bind(this)); |
| 113 }, |
| 114 |
| 95 /** | 115 /** |
| 96 * @param {string} url | 116 * @param {string} url |
| 97 * @return {WebInspector.NetworkRequest} | 117 * @return {WebInspector.NetworkRequest} |
| 98 */ | 118 */ |
| 99 inflightRequestForURL: function(url) | 119 inflightRequestForURL: function(url) |
| 100 { | 120 { |
| 101 return this._dispatcher._inflightRequestsByURL[url]; | 121 return this._dispatcher._inflightRequestsByURL[url]; |
| 102 }, | 122 }, |
| 103 | 123 |
| 104 /** | 124 /** |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 var networkRequest = new WebInspector.NetworkRequest(requestId, url, doc
umentURL, frameId, loaderId); | 605 var networkRequest = new WebInspector.NetworkRequest(requestId, url, doc
umentURL, frameId, loaderId); |
| 586 networkRequest.initiator = initiator; | 606 networkRequest.initiator = initiator; |
| 587 return networkRequest; | 607 return networkRequest; |
| 588 } | 608 } |
| 589 } | 609 } |
| 590 | 610 |
| 591 /** | 611 /** |
| 592 * @type {?WebInspector.NetworkManager} | 612 * @type {?WebInspector.NetworkManager} |
| 593 */ | 613 */ |
| 594 WebInspector.networkManager = null; | 614 WebInspector.networkManager = null; |
| OLD | NEW |