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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js

Issue 2931773002: DevTools: kill DebuggerWorkspaceBinding.{push,pop,set}SourceMapping (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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
index 7912234aa46a4d6416dfd8a701cca0f5b98c9f9d..0e90ae7c73ceb67ba3725123ff36805c4b4bc7e0 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js
@@ -151,6 +151,10 @@ Sources.SourceFormatter = class {
* @implements {Bindings.DebuggerSourceMapping}
*/
Sources.SourceFormatter.ScriptMapping = class {
+ constructor() {
+ Bindings.debuggerWorkspaceBinding.addSourceMapping(this);
+ }
+
/**
* @override
* @param {!SDK.DebuggerModel.Location} rawLocation
@@ -185,24 +189,6 @@ Sources.SourceFormatter.ScriptMapping = class {
return scripts[0].debuggerModel.createRawLocation(scripts[0], originalLocation[0], originalLocation[1]);
}
- /**
- * @override
- * @return {boolean}
- */
- isIdentity() {
- return false;
- }
-
- /**
- * @override
- * @param {!Workspace.UISourceCode} uiSourceCode
- * @param {number} lineNumber
- * @return {boolean}
- */
- uiLineHasMapping(uiSourceCode, lineNumber) {
- return true;
- }
-
/**
* @param {!Sources.SourceFormatData} formatData
* @param {boolean} enabled
@@ -212,19 +198,14 @@ Sources.SourceFormatter.ScriptMapping = class {
if (!scripts.length)
return;
if (enabled) {
- for (var script of scripts) {
+ for (var script of scripts)
script[Sources.SourceFormatData._formatDataSymbol] = formatData;
- Bindings.debuggerWorkspaceBinding.pushSourceMapping(script, this);
- }
} else {
- for (var script of scripts) {
+ for (var script of scripts)
delete script[Sources.SourceFormatData._formatDataSymbol];
- Bindings.debuggerWorkspaceBinding.popSourceMapping(script);
- }
}
-
- Bindings.debuggerWorkspaceBinding.setSourceMapping(
- scripts[0].debuggerModel, formatData.formattedSourceCode, enabled ? this : null);
+ for (var script of scripts)
+ Bindings.debuggerWorkspaceBinding.updateLocations(script);
}
/**
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698