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

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

Issue 2662513003: DevTools: make StylesSourceMapping in charge of creating and removing UISourceCodes (Closed)
Patch Set: move projects under stylessourcemapping 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/CSSWorkspaceBinding.js
diff --git a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
index 5f23a2fab0c96917dabb39851b119b3b4071a9a4..d0cc5a974f23ef179edbea3a2b7e3b1969a5dd34 100644
--- a/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
+++ b/third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js
@@ -147,9 +147,10 @@ Bindings.CSSWorkspaceBinding.TargetInfo = class {
*/
constructor(cssModel, workspace) {
this._cssModel = cssModel;
+ this._workspace = workspace;
+ var networkProject = Bindings.NetworkProject.forTarget(cssModel.target());
this._stylesSourceMapping = new Bindings.StylesSourceMapping(cssModel, workspace);
- this._sassSourceMapping =
- new Bindings.SASSSourceMapping(cssModel, workspace, Bindings.NetworkProject.forTarget(cssModel.target()));
+ this._sassSourceMapping = new Bindings.SASSSourceMapping(cssModel, workspace, networkProject);
/** @type {!Multimap<!SDK.CSSStyleSheetHeader, !Bindings.LiveLocation>} */
this._locations = new Multimap();
@@ -190,7 +191,14 @@ Bindings.CSSWorkspaceBinding.TargetInfo = class {
var uiLocation = null;
uiLocation = uiLocation || this._sassSourceMapping.rawLocationToUILocation(rawLocation);
uiLocation = uiLocation || this._stylesSourceMapping.rawLocationToUILocation(rawLocation);
- return uiLocation;
+ if (uiLocation)
+ return uiLocation;
+
+ var uiSourceCode =
lushnikov 2017/02/15 05:18:48 in future, this green chunk should be: uiLocat
+ Bindings.NetworkProject.uiSourceCodeForStyleURL(this._workspace, rawLocation.url, rawLocation.header());
+ if (!uiSourceCode)
+ return null;
+ return uiSourceCode.uiLocation(rawLocation.lineNumber, rawLocation.columnNumber);
}
_dispose() {

Powered by Google App Engine
This is Rietveld 408576698