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", | |
54 RequestStarted: "RequestStarted", | 52 RequestStarted: "RequestStarted", |
55 RequestUpdated: "RequestUpdated", | 53 RequestUpdated: "RequestUpdated", |
56 RequestFinished: "RequestFinished", | 54 RequestFinished: "RequestFinished", |
57 RequestUpdateDropped: "RequestUpdateDropped" | 55 RequestUpdateDropped: "RequestUpdateDropped" |
58 } | 56 } |
59 | 57 |
60 WebInspector.NetworkManager._MIMETypes = { | 58 WebInspector.NetworkManager._MIMETypes = { |
61 "text/html": {"document": true}, | 59 "text/html": {"document": true}, |
62 "text/xml": {"document": true}, | 60 "text/xml": {"document": true}, |
63 "text/plain": {"document": true}, | 61 "text/plain": {"document": true}, |
(...skipping 23 matching lines...) Expand all Loading... |
87 "application/x-javascript": {"script": true}, | 85 "application/x-javascript": {"script": true}, |
88 "application/json": {"script": true}, | 86 "application/json": {"script": true}, |
89 "text/javascript1.1": {"script": true}, | 87 "text/javascript1.1": {"script": true}, |
90 "text/javascript1.2": {"script": true}, | 88 "text/javascript1.2": {"script": true}, |
91 "text/javascript1.3": {"script": true}, | 89 "text/javascript1.3": {"script": true}, |
92 "text/jscript": {"script": true}, | 90 "text/jscript": {"script": true}, |
93 "text/livescript": {"script": true}, | 91 "text/livescript": {"script": true}, |
94 } | 92 } |
95 | 93 |
96 WebInspector.NetworkManager.prototype = { | 94 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 | |
115 /** | 95 /** |
116 * @param {string} url | 96 * @param {string} url |
117 * @return {WebInspector.NetworkRequest} | 97 * @return {WebInspector.NetworkRequest} |
118 */ | 98 */ |
119 inflightRequestForURL: function(url) | 99 inflightRequestForURL: function(url) |
120 { | 100 { |
121 return this._dispatcher._inflightRequestsByURL[url]; | 101 return this._dispatcher._inflightRequestsByURL[url]; |
122 }, | 102 }, |
123 | 103 |
124 /** | 104 /** |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 var networkRequest = new WebInspector.NetworkRequest(requestId, url, doc
umentURL, frameId, loaderId); | 585 var networkRequest = new WebInspector.NetworkRequest(requestId, url, doc
umentURL, frameId, loaderId); |
606 networkRequest.initiator = initiator; | 586 networkRequest.initiator = initiator; |
607 return networkRequest; | 587 return networkRequest; |
608 } | 588 } |
609 } | 589 } |
610 | 590 |
611 /** | 591 /** |
612 * @type {?WebInspector.NetworkManager} | 592 * @type {?WebInspector.NetworkManager} |
613 */ | 593 */ |
614 WebInspector.networkManager = null; | 594 WebInspector.networkManager = null; |
OLD | NEW |