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

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

Issue 2893523002: DevTools: make StyleSourceMapping in charge of managing UISourceCodes (Closed)
Patch Set: address comments Created 3 years, 6 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 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}

Powered by Google App Engine
This is Rietveld 408576698