Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: Source/devtools/front_end/sdk/NetworkManager.js

Issue 400633003: DevTools: introduce multitarget model listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.SDKObject} 33 * @extends {WebInspector.SDKModel}
34 * @param {!WebInspector.Target} target 34 * @param {!WebInspector.Target} target
35 */ 35 */
36 WebInspector.NetworkManager = function(target) 36 WebInspector.NetworkManager = function(target)
37 { 37 {
38 WebInspector.SDKObject.call(this, target); 38 WebInspector.SDKModel.call(this, WebInspector.NetworkManager, target);
39 this._dispatcher = new WebInspector.NetworkDispatcher(this); 39 this._dispatcher = new WebInspector.NetworkDispatcher(this);
40 this._target = target; 40 this._target = target;
41 this._networkAgent = target.networkAgent(); 41 this._networkAgent = target.networkAgent();
42 target.registerNetworkDispatcher(this._dispatcher); 42 target.registerNetworkDispatcher(this._dispatcher);
43 if (WebInspector.settings.cacheDisabled.get()) 43 if (WebInspector.settings.cacheDisabled.get())
44 this._networkAgent.setCacheDisabled(true); 44 this._networkAgent.setCacheDisabled(true);
45 45
46 this._networkAgent.enable(); 46 this._networkAgent.enable();
47 47
48 WebInspector.settings.cacheDisabled.addChangeListener(this._cacheDisabledSet tingChanged, this); 48 WebInspector.settings.cacheDisabled.addChangeListener(this._cacheDisabledSet tingChanged, this);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 { 128 {
129 var enabled = /** @type {boolean} */ (event.data); 129 var enabled = /** @type {boolean} */ (event.data);
130 this._networkAgent.setCacheDisabled(enabled); 130 this._networkAgent.setCacheDisabled(enabled);
131 }, 131 },
132 132
133 dispose: function() 133 dispose: function()
134 { 134 {
135 WebInspector.settings.cacheDisabled.removeChangeListener(this._cacheDisa bledSettingChanged, this) 135 WebInspector.settings.cacheDisabled.removeChangeListener(this._cacheDisa bledSettingChanged, this)
136 }, 136 },
137 137
138 __proto__: WebInspector.SDKObject.prototype 138 __proto__: WebInspector.SDKModel.prototype
139 } 139 }
140 140
141 /** 141 /**
142 * @constructor 142 * @constructor
143 * @implements {NetworkAgent.Dispatcher} 143 * @implements {NetworkAgent.Dispatcher}
144 */ 144 */
145 WebInspector.NetworkDispatcher = function(manager) 145 WebInspector.NetworkDispatcher = function(manager)
146 { 146 {
147 this._manager = manager; 147 this._manager = manager;
148 this._inflightRequestsById = {}; 148 this._inflightRequestsById = {};
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 * @param {string} documentURL 563 * @param {string} documentURL
564 * @param {!NetworkAgent.Initiator} initiator 564 * @param {!NetworkAgent.Initiator} initiator
565 */ 565 */
566 _createNetworkRequest: function(requestId, frameId, loaderId, url, documentU RL, initiator) 566 _createNetworkRequest: function(requestId, frameId, loaderId, url, documentU RL, initiator)
567 { 567 {
568 var networkRequest = new WebInspector.NetworkRequest(this._manager._targ et, requestId, url, documentURL, frameId, loaderId); 568 var networkRequest = new WebInspector.NetworkRequest(this._manager._targ et, requestId, url, documentURL, frameId, loaderId);
569 networkRequest.initiator = initiator; 569 networkRequest.initiator = initiator;
570 return networkRequest; 570 return networkRequest;
571 } 571 }
572 } 572 }
573
574 /**
575 * @type {!WebInspector.NetworkManager}
576 */
577 WebInspector.networkManager;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/HeapProfilerModel.js ('k') | Source/devtools/front_end/sdk/NetworkUISourceCodeProvider.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698