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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js

Issue 2408203007: DevTools: teach network UISourceCodes to return metadata (Closed)
Patch Set: address comments Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
index 6a73da5aca92601d8a5b3c48d9fe07bc694afb1a..1d5dceb78c0fa8c148b27101cf2922a39462b087 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/ResourceTreeModel.js
@@ -727,16 +727,12 @@ WebInspector.ResourceTreeFrame.prototype = {
*/
resourceForURL: function(url)
{
- var result;
- function filter(resource)
- {
- if (resource.url === url) {
- result = resource;
- return true;
- }
- }
- this._callForFrameResources(filter);
- return result || null;
+ var resource = this._resourcesMap[url] || null;
+ if (resource)
+ return resource;
+ for (var i = 0; !resource && i < this._childFrames.length; ++i)
+ resource = this._childFrames[i].resourceForURL(url);
+ return resource;
},
/**

Powered by Google App Engine
This is Rietveld 408576698