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

Unified Diff: third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js

Issue 2662513003: DevTools: make StylesSourceMapping in charge of creating and removing UISourceCodes (Closed)
Patch Set: cleanup & addres comments Created 3 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 side-by-side diff with in-line comments
Download patch
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 d586241f4805d4a1157c889ca3d8833f6b851b2b..8ddd2c9e82f24b48e85982113a064a5b4c7660d0 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/ResourceUtils.js
@@ -86,3 +86,13 @@ 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());
+};

Powered by Google App Engine
This is Rietveld 408576698