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

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

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/RemoteObject.js ('k') | Source/devtools/front_end/sdk/RuntimeModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698