RESOLVED FIXED 196230
Web Inspector: Debugger: modernize serialization of breakpoints and the maps that hold them
https://bugs.webkit.org/show_bug.cgi?id=196230
Summary Web Inspector: Debugger: modernize serialization of breakpoints and the maps ...
Devin Rousso
Reported 2019-03-25 16:52:18 PDT
Leverage static `deserialize` functions, as well as `Multimap`s to hold the breakpoints.
Attachments
Patch (22.21 KB, patch)
2019-03-25 16:56 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews104 for mac-highsierra-wk2 (2.76 MB, application/zip)
2019-03-25 17:53 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews101 for mac-highsierra (2.45 MB, application/zip)
2019-03-25 18:00 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews117 for mac-highsierra (2.37 MB, application/zip)
2019-03-25 19:14 PDT, EWS Watchlist
no flags
Patch (21.97 KB, patch)
2019-03-26 10:53 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews204 for win-future (12.88 MB, application/zip)
2019-03-26 14:00 PDT, EWS Watchlist
no flags
Patch (25.65 KB, patch)
2019-04-01 16:06 PDT, Devin Rousso
no flags
Radar WebKit Bug Importer
Comment 1 2019-03-25 16:55:02 PDT
Devin Rousso
Comment 2 2019-03-25 16:56:36 PDT
EWS Watchlist
Comment 3 2019-03-25 17:53:33 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 4 2019-03-25 17:53:34 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2019-03-25 18:00:45 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 6 2019-03-25 18:00:47 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2019-03-25 19:14:28 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 8 2019-03-25 19:14:30 PDT Comment hidden (obsolete)
Devin Rousso
Comment 9 2019-03-26 10:53:35 PDT
EWS Watchlist
Comment 10 2019-03-26 13:59:56 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 11 2019-03-26 14:00:07 PDT Comment hidden (obsolete)
Joseph Pecoraro
Comment 12 2019-04-01 14:47:40 PDT
Comment on attachment 365975 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=365975&action=review r=me > Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js:223 > + return Array.from(this.breakpointsForSourceCode(sourceCode.sourceMap.originalSourceCode)) > + .filter((breakpoint) => breakpoint.sourceCodeLocation.displaySourceCode === sourceCode); I don't think this is our usual style. $ ack '^\s+\.[^.]' **/*.js -B 1 --ignore External It is vastly more common to keep this on one line or to at least put the function name on the same line: return Array.from(this.breakpointsForSourceCode(sourceCode.sourceMap.originalSourceCode)).filter((breakpoint) => { return breakpoint.sourceCodeLocation.displaySourceCode === sourceCode; }); > Source/WebInspectorUI/UserInterface/Models/Breakpoint.js:-33 > - if (sourceCodeLocationOrInfo instanceof WI.SourceCodeLocation) { > - var sourceCode = sourceCodeLocationOrInfo.sourceCode; Some of the oldest ugliest code. Glad to see this cleaned up! > Source/WebInspectorUI/UserInterface/Models/Breakpoint.js:41 > + this._sourceCodeLocation = sourceCodeLocation; After this I'd put: this._contentIdentifier = null; It used to be `null` and would otherwise be `undefined` with this patch for special breakpoints. > Source/WebInspectorUI/UserInterface/Models/Breakpoint.js:64 > + // Static We can make this an "Import / Export" section and put `deserialize` (or `fromJSON`) and `toJSON` next to each other to it is easy to compare them. > Source/WebInspectorUI/UserInterface/Models/Breakpoint.js:70 > + // The 'url' fallback is for transitioning from older frontends and should be removed. Now might be a good time to remove it! > Source/WebInspectorUI/UserInterface/Models/Breakpoint.js:244 > - return newAction; > + return this._actions[index]; Would be easier to avoid the lookup again by storing the new action in a local. Especially given someone could modify this_actions in the event handler. > Source/WebInspectorUI/UserInterface/Models/BreakpointAction.js:39 > + // Static Same here re: "Import / Export" or at least putting it by the toJSON. Also, we don't use the "id" in deserialization, but we presumably do for the protocol? There should probably be a toProtocol() [protocol] instead of toJSON() [serialization].
Devin Rousso
Comment 13 2019-04-01 16:06:31 PDT
WebKit Commit Bot
Comment 14 2019-04-01 17:20:17 PDT
Comment on attachment 366435 [details] Patch Clearing flags on attachment: 366435 Committed r243727: <https://trac.webkit.org/changeset/243727>
WebKit Commit Bot
Comment 15 2019-04-01 17:20:18 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.