Index: third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js |
index 006a493f5c201934674148ef7ed4418e99d1a510..3e465e30f4f1faf19eea7d362709d378cfb9f71b 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js |
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js |
@@ -85,6 +85,22 @@ Bindings.displayNameForURL = function(url) { |
return displayName === '/' ? parsedURL.host + '/' : displayName; |
}; |
+/** |
+ * @param {!SDK.Target} target |
+ * @param {string} frameId |
+ * @param {string} url |
+ * @return {?Workspace.UISourceCodeMetadata} |
+ */ |
+Bindings.metadataForURL = function(target, frameId, url) { |
+ var resourceTreeModel = target.model(SDK.ResourceTreeModel); |
+ if (!resourceTreeModel) |
+ return null; |
+ var frame = resourceTreeModel.frameForId(frameId); |
+ if (!frame) |
+ return null; |
+ return Bindings.resourceMetadata(frame.resourceForURL(url)); |
+}; |
+ |
/** |
* @param {?SDK.Resource} resource |
* @return {?Workspace.UISourceCodeMetadata} |