Chromium Code Reviews| 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 |
| @@ -86,6 +86,22 @@ Bindings.displayNameForURL = function(url) { |
| }; |
| /** |
| + * @param {!SDK.Target} target |
| + * @param {string} frameId |
| + * @param {string} url |
| + * @return {?Workspace.UISourceCodeMetadata} |
| + */ |
| +Bindings.metadataForURL = function(target, frameId, url) { |
|
dgozman
2017/05/17 16:46:20
resourceMetadataForURL?
|
| + 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} |
| */ |