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 17 matching lines...) Expand all Loading... |
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.NetworkManager} networkManager |
35 */ | 35 */ |
36 WebInspector.ResourceTreeModel = function(networkManager) | 36 WebInspector.ResourceTreeModel = function(networkManager) |
37 { | 37 { |
38 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Resou
rceTrackingEnabled, this._onResourceTrackingEnabled, this); | |
39 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque
stUpdated, this._onRequestUpdated, this); | 38 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque
stUpdated, this._onRequestUpdated, this); |
40 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque
stFinished, this._onRequestUpdated, this); | 39 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque
stFinished, this._onRequestUpdated, this); |
41 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque
stUpdateDropped, this._onRequestUpdateDropped, this); | 40 networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.Reque
stUpdateDropped, this._onRequestUpdateDropped, this); |
42 | 41 |
43 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.Messa
geAdded, this._consoleMessageAdded, this); | 42 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.Messa
geAdded, this._consoleMessageAdded, this); |
44 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.Repea
tCountUpdated, this._consoleMessageAdded, this); | 43 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.Repea
tCountUpdated, this._consoleMessageAdded, this); |
45 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.Conso
leCleared, this._consoleCleared, this); | 44 WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.Conso
leCleared, this._consoleCleared, this); |
46 | 45 |
47 PageAgent.enable(); | 46 PageAgent.enable(); |
48 | 47 |
(...skipping 12 matching lines...) Expand all Loading... |
61 MainFrameNavigated: "MainFrameNavigated", | 60 MainFrameNavigated: "MainFrameNavigated", |
62 ResourceAdded: "ResourceAdded", | 61 ResourceAdded: "ResourceAdded", |
63 WillLoadCachedResources: "WillLoadCachedResources", | 62 WillLoadCachedResources: "WillLoadCachedResources", |
64 CachedResourcesLoaded: "CachedResourcesLoaded", | 63 CachedResourcesLoaded: "CachedResourcesLoaded", |
65 DOMContentLoaded: "DOMContentLoaded", | 64 DOMContentLoaded: "DOMContentLoaded", |
66 OnLoad: "OnLoad", | 65 OnLoad: "OnLoad", |
67 InspectedURLChanged: "InspectedURLChanged" | 66 InspectedURLChanged: "InspectedURLChanged" |
68 } | 67 } |
69 | 68 |
70 WebInspector.ResourceTreeModel.prototype = { | 69 WebInspector.ResourceTreeModel.prototype = { |
71 _onResourceTrackingEnabled: function() | |
72 { | |
73 this._fetchResourceTree(); | |
74 }, | |
75 | |
76 _fetchResourceTree: function() | 70 _fetchResourceTree: function() |
77 { | 71 { |
78 this._frames = {}; | 72 this._frames = {}; |
79 delete this._cachedResourcesProcessed; | 73 delete this._cachedResourcesProcessed; |
80 PageAgent.getResourceTree(this._processCachedResources.bind(this)); | 74 PageAgent.getResourceTree(this._processCachedResources.bind(this)); |
81 }, | 75 }, |
82 | 76 |
83 _processCachedResources: function(error, mainFramePayload) | 77 _processCachedResources: function(error, mainFramePayload) |
84 { | 78 { |
85 if (error) { | 79 if (error) { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 frameDetached: function(frameId) | 609 frameDetached: function(frameId) |
616 { | 610 { |
617 this._resourceTreeModel._frameDetached(frameId); | 611 this._resourceTreeModel._frameDetached(frameId); |
618 } | 612 } |
619 } | 613 } |
620 | 614 |
621 /** | 615 /** |
622 * @type {WebInspector.ResourceTreeModel} | 616 * @type {WebInspector.ResourceTreeModel} |
623 */ | 617 */ |
624 WebInspector.resourceTreeModel = null; | 618 WebInspector.resourceTreeModel = null; |
OLD | NEW |