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

Side by Side Diff: Source/devtools/front_end/ResourceTreeModel.js

Issue 185463010: DevTools: Introduce Target class which holds connection & models (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@gr-RuntimeAgent
Patch Set: Address aandrey's comments Created 6 years, 9 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
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 13 matching lines...) Expand all
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.Object} 33 * @extends {WebInspector.Object}
34 * @param {!WebInspector.NetworkManager} networkManager 34 * @param {!WebInspector.Target} target
35 * @param {!WebInspector.ConsoleModel} consoleModel
36 */ 35 */
37 WebInspector.ResourceTreeModel = function(networkManager, consoleModel) 36 WebInspector.ResourceTreeModel = function(target)
38 { 37 {
39 this._agent = PageAgent; 38 this._agent = target.agent("Page");
40 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque stFinished, this._onRequestFinished, this); 39 target.networkManager.addEventListener(WebInspector.NetworkManager.EventType s.RequestFinished, this._onRequestFinished, this);
41 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque stUpdateDropped, this._onRequestUpdateDropped, this); 40 target.networkManager.addEventListener(WebInspector.NetworkManager.EventType s.RequestUpdateDropped, this._onRequestUpdateDropped, this);
42 41
43 consoleModel.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._consoleMessageAdded, this); 42 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Messag eAdded, this._consoleMessageAdded, this);
44 consoleModel.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUp dated, this._consoleMessageAdded, this); 43 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Repeat CountUpdated, this._consoleMessageAdded, this);
45 consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleare d, this._consoleCleared, this); 44 target.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.Consol eCleared, this._consoleCleared, this);
46 45
47 this._agent.enable(); 46 this._agent.enable();
48 47
49 this._fetchResourceTree(); 48 this._fetchResourceTree();
50 49
51 InspectorBackend.registerPageDispatcher(new WebInspector.PageDispatcher(this )); 50 target.registerDispatcher("Page", new WebInspector.PageDispatcher(this));
52 51
53 this._pendingConsoleMessages = {}; 52 this._pendingConsoleMessages = {};
54 this._securityOriginFrameCount = {}; 53 this._securityOriginFrameCount = {};
55 } 54 }
56 55
57 WebInspector.ResourceTreeModel.EventTypes = { 56 WebInspector.ResourceTreeModel.EventTypes = {
58 FrameAdded: "FrameAdded", 57 FrameAdded: "FrameAdded",
59 FrameNavigated: "FrameNavigated", 58 FrameNavigated: "FrameNavigated",
60 FrameDetached: "FrameDetached", 59 FrameDetached: "FrameDetached",
61 FrameResized: "FrameResized", 60 FrameResized: "FrameResized",
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 screencastVisibilityChanged: function(visible) 789 screencastVisibilityChanged: function(visible)
791 { 790 {
792 this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTr eeModel.EventTypes.ScreencastVisibilityChanged, {visible:visible}); 791 this._resourceTreeModel.dispatchEventToListeners(WebInspector.ResourceTr eeModel.EventTypes.ScreencastVisibilityChanged, {visible:visible});
793 } 792 }
794 } 793 }
795 794
796 /** 795 /**
797 * @type {!WebInspector.ResourceTreeModel} 796 * @type {!WebInspector.ResourceTreeModel}
798 */ 797 */
799 WebInspector.resourceTreeModel; 798 WebInspector.resourceTreeModel;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698