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