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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 WillReloadPage: "WillReloadPage", | 69 WillReloadPage: "WillReloadPage", |
70 InspectedURLChanged: "InspectedURLChanged", | 70 InspectedURLChanged: "InspectedURLChanged", |
71 SecurityOriginAdded: "SecurityOriginAdded", | 71 SecurityOriginAdded: "SecurityOriginAdded", |
72 SecurityOriginRemoved: "SecurityOriginRemoved", | 72 SecurityOriginRemoved: "SecurityOriginRemoved", |
73 ScreencastFrame: "ScreencastFrame", | 73 ScreencastFrame: "ScreencastFrame", |
74 ScreencastVisibilityChanged: "ScreencastVisibilityChanged", | 74 ScreencastVisibilityChanged: "ScreencastVisibilityChanged", |
75 ViewportChanged: "ViewportChanged", | 75 ViewportChanged: "ViewportChanged", |
76 ColorPicked: "ColorPicked" | 76 ColorPicked: "ColorPicked" |
77 } | 77 } |
78 | 78 |
| 79 |
| 80 /** |
| 81 * @return {!Array.<!WebInspector.ResourceTreeFrame>} |
| 82 */ |
| 83 WebInspector.ResourceTreeModel.frames = function() |
| 84 { |
| 85 var result = []; |
| 86 for (var target of WebInspector.targetManager.targets()) |
| 87 result = result.concat(Object.values(target.resourceTreeModel._frames)); |
| 88 return result; |
| 89 } |
| 90 |
| 91 /** |
| 92 * @param {string} url |
| 93 * @return {?WebInspector.Resource} |
| 94 */ |
| 95 WebInspector.ResourceTreeModel.resourceForURL = function(url) |
| 96 { |
| 97 for (var target of WebInspector.targetManager.targets()) { |
| 98 var mainFrame = target.resourceTreeModel.mainFrame; |
| 99 var result = mainFrame ? mainFrame.resourceForURL(url) : null; |
| 100 if (result) |
| 101 return result; |
| 102 } |
| 103 return null; |
| 104 } |
| 105 |
79 WebInspector.ResourceTreeModel.prototype = { | 106 WebInspector.ResourceTreeModel.prototype = { |
80 _fetchResourceTree: function() | 107 _fetchResourceTree: function() |
81 { | 108 { |
82 /** @type {!Object.<string, !WebInspector.ResourceTreeFrame>} */ | 109 /** @type {!Object.<string, !WebInspector.ResourceTreeFrame>} */ |
83 this._frames = {}; | 110 this._frames = {}; |
84 delete this._cachedResourcesProcessed; | 111 delete this._cachedResourcesProcessed; |
85 this._agent.getResourceTree(this._processCachedResources.bind(this)); | 112 this._agent.getResourceTree(this._processCachedResources.bind(this)); |
86 }, | 113 }, |
87 | 114 |
88 _processCachedResources: function(error, mainFramePayload) | 115 _processCachedResources: function(error, mainFramePayload) |
(...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
902 }, | 929 }, |
903 | 930 |
904 /** | 931 /** |
905 * @override | 932 * @override |
906 */ | 933 */ |
907 interstitialHidden: function() | 934 interstitialHidden: function() |
908 { | 935 { |
909 // Frontend is not interested in interstitials. | 936 // Frontend is not interested in interstitials. |
910 } | 937 } |
911 } | 938 } |
912 | |
913 /** | |
914 * @type {!WebInspector.ResourceTreeModel} | |
915 */ | |
916 WebInspector.resourceTreeModel; | |
OLD | NEW |