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

Issue 2931773002: DevTools: kill DebuggerWorkspaceBinding.{push,pop,set}SourceMapping (Closed)

Created:
3 years, 6 months ago by lushnikov
Modified:
3 years, 6 months ago
Reviewers:
dgozman
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, pfeldman, kozyatinskiy+blink_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: kill DebuggerWorkspaceBinding.{push,pop,set}SourceMapping Today, there are three methods to manage mapping between scripts and uiSourceCodes: - pushSourceMapping: adds a raw to ui mapping for the scripts - popSourceMapping: removes a raw to ui mapping from the script - setSourceMapping: establishes a ui to raw mapping from uiSourceCode to script These methods have a few disadvantages: - adding mapping per-script is a memory-consuming approach, given how many scripts DevTools occasionally has - the push/pop API is invalid and does not allow to remove mapping. For this reason, the popSourceMapping is almost never used. - existence of a separate setSourceMapping method to setup a backward mapping means that there's no guarantee that: rawLocation == ui2raw(raw2ui(rawLocation)) This patch kills the {push,pop,set}SourceMapping methods in favor of a simplistic approach, already implemented in CSSWorkspaceBindings: 1. external mappings (Such as snippets and SourceFormatter) are registered via the DebuggerWorkspaceBidning.addSourceMapping method 2. the raw to ui mapping is: - querying external mappings first - queries CompilerScriptMapping (sourceMaps) - queries ResourceScriptMapping (regular mapping) - queries DefaultScriptMapping (VM UISourceCodes) 3. the ui to raw mapping queries mappings in the same order as raw to ui. Additionally, with the new persistence, mappings are never actually change: there's *ALWAYS ONLY ONE* mapping which controls both lifetime and mapping of each UISourceCode. This means that the DebuggerWorkspace.SourceMappingChanged event is not needed. To sum up, this patch: - kills push/pop/set methods in favor of a simplistic approach, already implemented in CSSWorkspaceBinding. - gets rid of DebuggerWorkspaceBinding.SourceMappingChanged event. It's not needed since mappings never actually change - cleans up the DebuggerSourceMapping interface: there's no more need for the isIdentity and uiLineHasMapping methods. R=dgozman BUG=670180 Review-Url: https://codereview.chromium.org/2931773002 Cr-Commit-Position: refs/heads/master@{#478142} Committed: https://chromium.googlesource.com/chromium/src/+/96693ab93867d6a24f3262d9cbb0df5cf102202b

Patch Set 1 #

Total comments: 14

Patch Set 2 : address comments #

Total comments: 2

Patch Set 3 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -521 lines) Patch
M third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html View 2 chunks +0 lines, -111 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.js View 3 chunks +0 lines, -17 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager-expected.txt View 2 chunks +0 lines, -106 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/BreakpointManager.js View 2 chunks +0 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/CSSWorkspaceBinding.js View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/CompilerScriptMapping.js View 4 chunks +5 lines, -16 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/DebuggerWorkspaceBinding.js View 1 12 chunks +61 lines, -144 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/DefaultScriptMapping.js View 3 chunks +3 lines, -21 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/bindings/ResourceScriptMapping.js View 1 5 chunks +4 lines, -22 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js View 1 2 8 chunks +31 lines, -23 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js View 4 chunks +5 lines, -17 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/sources/SourceFormatter.js View 3 chunks +8 lines, -27 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 21 (14 generated)
lushnikov
please, take a look!
3 years, 6 months ago (2017-06-08 15:04:57 UTC) #3
dgozman
https://codereview.chromium.org/2931773002/diff/1/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html File third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html (left): https://codereview.chromium.org/2931773002/diff/1/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html#oldcode176 third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html:176: function testSourceMapping(next) Please ensure we have a test for ...
3 years, 6 months ago (2017-06-08 19:12:04 UTC) #9
lushnikov
please, take another look https://codereview.chromium.org/2931773002/diff/1/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html File third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html (left): https://codereview.chromium.org/2931773002/diff/1/third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html#oldcode176 third_party/WebKit/LayoutTests/inspector/sources/debugger-breakpoints/breakpoint-manager.html:176: function testSourceMapping(next) On 2017/06/08 19:12:00, ...
3 years, 6 months ago (2017-06-08 21:14:34 UTC) #11
dgozman
lgtm https://codereview.chromium.org/2931773002/diff/20001/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js File third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js (right): https://codereview.chromium.org/2931773002/diff/20001/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js#newcode370 third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js:370: * @implements {Bindings.DebuggerSourceMapping} Remove
3 years, 6 months ago (2017-06-08 22:25:17 UTC) #14
lushnikov
https://codereview.chromium.org/2931773002/diff/20001/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js File third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js (right): https://codereview.chromium.org/2931773002/diff/20001/third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js#newcode370 third_party/WebKit/Source/devtools/front_end/snippets/ScriptSnippetModel.js:370: * @implements {Bindings.DebuggerSourceMapping} On 2017/06/08 22:25:16, dgozman wrote: > ...
3 years, 6 months ago (2017-06-08 22:34:25 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2931773002/40001
3 years, 6 months ago (2017-06-08 22:35:20 UTC) #18
commit-bot: I haz the power
3 years, 6 months ago (2017-06-09 00:56:21 UTC) #21
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/96693ab93867d6a24f3262d9cbb0...

Powered by Google App Engine
This is Rietveld 408576698