| 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 dec3afbe0bf96e1ce5ee45bb8fe9e425cd37c900..006a493f5c201934674148ef7ed4418e99d1a510 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
|
| @@ -84,3 +84,28 @@ Bindings.displayNameForURL = function(url) {
|
| var displayName = url.trimURL(parsedURL.host);
|
| return displayName === '/' ? parsedURL.host + '/' : displayName;
|
| };
|
| +
|
| +/**
|
| + * @param {?SDK.Resource} resource
|
| + * @return {?Workspace.UISourceCodeMetadata}
|
| + */
|
| +Bindings.resourceMetadata = function(resource) {
|
| + if (!resource || (typeof resource.contentSize() !== 'number' && !resource.lastModified()))
|
| + return null;
|
| + return new Workspace.UISourceCodeMetadata(resource.lastModified(), resource.contentSize());
|
| +};
|
| +
|
| +/**
|
| + * @param {!SDK.Script} script
|
| + * @return {string}
|
| + */
|
| +Bindings.frameIdForScript = function(script) {
|
| + var executionContext = script.executionContext();
|
| + if (executionContext)
|
| + return executionContext.frameId || '';
|
| + // This is to overcome compilation cache which doesn't get reset.
|
| + var resourceTreeModel = script.debuggerModel.target().model(SDK.ResourceTreeModel);
|
| + if (!resourceTreeModel || !resourceTreeModel.mainFrame)
|
| + return '';
|
| + return resourceTreeModel.mainFrame.id;
|
| +};
|
|
|