Commit Graph
103 Commits
Author SHA1 Message Date
Kateryna Prokopenko fbb2247690 Type all path and URL variables in ui/legacy to Branded Types
Bug: 1299791
Change-Id: I3648366445238aeb30fa699556fa9d9a4ee937e6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3629859
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-05-11 09:39:12 +00:00
Kim-Anh Tran 236603bacb [BreakpointManager] Make removing breakpoints awaitable
This CL removes a race that may happen if PersistenceImpl tries to
move a breakpoint from one UISourceCode to another UISourceCode by
explicitly awaiting the calls to remove/setBreakpoint in
PersistenceImpl.

The race happens in the following case (affecting snippets):
* A snippet is created, and the user sets a breakpoint and reloads
  the page.
* PersistenceImpl.ts will try to move the breakpoint via
  1. removing the breakpoint from the old UISourceCode, and
  2. re-setting the breakpoint on the new UISourceCode.
* Simultaneously, the BreakpointManager tries to set a breakpoint
  on the new UISourceCode
* For snippets, the url stays the same after reloading, and in some
  cases the `setBreakpointByURL` of the PersistenceImpl and the
  BreakpointManager will be sent to v8 one after another, such that
  v8 returns a ServerError, as it has already set the breakpoint
  previously

This race causes the breakpoint to completely disappear, since
DevTools front-end removes the breakpoint if it sees a ServerError.

Drive-by: Added additional clean up step to tests.

Bug: 1280621
Change-Id: I7c9cd94c02d80661100cc5c5141e7d0dbb027f6d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3629862
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-05-10 10:13:21 +00:00
Philip Pfaffe 63c982bd16 Synchronize breakpoints for language plugins as well
Bug: chromium:1229541
Change-Id: Ifb87690664615f3a7c2452bb70619fd743bb0d77
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3581033
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-04-29 13:18:03 +00:00
Kim-Anh Tran facefdbfe3 [unittest] Add test for synchronizing on instrumentation break
This adds a test for checking if the functionality of
`restoreBreakpointsForScript` in the BreakpointManager. This function
is used in order to synchronize breakpoints on instrumentation
breaks.

Bug: 1229541
Change-Id: I56d33acf329da03948b612c4e003e996302497bf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598877
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-04-27 10:19:48 +00:00
Kim-Anh Tran f58a83ed9c Reland "Enable synchronization on instrumentation breakpoints"
This is a reland of commit 1b596f3b4b.

Changes:
1. Gated behind an experiment
2. Removed changes that are currently not used since it's gated
   (i.e. test changes)

Original change's description:
> Enable synchronization on instrumentation breakpoints
>
> This CL introduces the synchronization point for setting
> breakpoints on new scripts using instrumentation breakpoints.
>
> Instrumentation breakpoints will trigger at the first statement
> of a newly run script. Afterwards we wait for all resources
> that we need to set a breakpoint (if one is cached for that
> particular script), set it, and resume.
>
> Note: this will not correctly synchronize the case where we
> just opened DevTools or just created a new target, as at this
> point some scripts might have started running. For this, we
> need to synchronize the Debugger.enable call, which is something
> that is left to take care of.
>
> Bug: chromium:1229541, chromium:1133307, chromium:1300509
> Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>

Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I19553ddac9530fa3ccac6b245a3dd89da88c6d51
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3542248
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-04-21 07:43:46 +00:00
Danil Somsikov 83ee912f56 Unit tests for the changes to StylesSidebarPane and WorkspaceDiff.ts from crrev.com/c/3466037
Bug: 1268754
Change-Id: I63a55c4edcf4670888425cbba4d443c5a8241eef
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3560418
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2022-03-30 12:05:29 +00:00
Kateryna Prokopenko 684d26dccd Type all path and URL variables in models/persistence to Branded Types
Bug: 1299776
Change-Id: I7fa3cc202a2d230e6fbde6c0472ab6750012fa49
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3542251
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-28 12:00:19 +00:00
Danil Somsikov e4e83a5a1b A unit test for the change to BreakpointManager from crrev.com/c/3361035
Bug: 1229541, 1133307
Change-Id: I92dc9732912e83aa53f8ff93e241c2910eb16525
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3553100
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-03-25 21:08:43 +00:00
Kateryna Prokopenko 3bdf13b6fa Type all path and URL variables in models/bindings to Branded Types
Bug: 1299775
Change-Id: Id940efff57c4370173b3f640d7e17e9f86ac0c1a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3541299
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-24 13:28:47 +00:00
Kateryna Prokopenko c64378bc34 Type path and URL vars in ContentProviderBasedProject to Branded Types
Return type of fullDisplayName cannot be set to Branded Type as it depends on the type of uiSourceCode.nameInternal, which can be any of Branded Types

Bug: 1299775
Change-Id: I84ce9b3a5535c6614b4d3486a6af7b979aa19da3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484208
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-22 16:20:40 +00:00
Kateryna Prokopenko 639a9de9d1 Type all URL and path variables in UISourceCode to Branded Types
Bug: 1299780
Change-Id: I133ae77524d058cddcecb220fec1f7bd52116183
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484202
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-22 11:27:28 +00:00
Kateryna Prokopenko 2a1b3a93b0 Type all path and URL variables in WorkspaceImpl to Branded Types
Bug: 1299780
Change-Id: I1dffe6edc834cf5914d48c4e331510b1866f78b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484200
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-22 10:45:29 +00:00
Kateryna Prokopenko 380fdfac97 Type all URL and path variables in FileManager to Branded Types
Bug: 1299780
Change-Id: I65c083c166ea4e57938f14e4d9ff3b96b2c03083
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3484197
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-16 17:26:57 +00:00
Kateryna Prokopenko ac21da4db6 Type path in createFile as EncodedPathString
Bug: 1253323
Change-Id: Icc520f383e032a8a6be8cbaffded2d2896ac4d37
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470238
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-14 13:04:15 +00:00
Kateryna Prokopenko 43b58939ab Remove casts to EncodedPathString from ScriptSnippetFileSystem
Bug: 1299786
Change-Id: I8b874211d44bc203391819a4653447a67b8c2fe1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470236
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-03-14 09:33:46 +00:00
Kim-Anh Tran bbb5232d14 Revert "Enable synchronization on instrumentation breakpoints"
This reverts commit 1b596f3b4b.

Reason for revert: closed the tree, more blink tests to adapt

Original change's description:
> Enable synchronization on instrumentation breakpoints
>
> This CL introduces the synchronization point for setting
> breakpoints on new scripts using instrumentation breakpoints.
>
> Instrumentation breakpoints will trigger at the first statement
> of a newly run script. Afterwards we wait for all resources
> that we need to set a breakpoint (if one is cached for that
> particular script), set it, and resume.
>
> Note: this will not correctly synchronize the case where we
> just opened DevTools or just created a new target, as at this
> point some scripts might have started running. For this, we
> need to synchronize the Debugger.enable call, which is something
> that is left to take care of.
>
> Bug: chromium:1229541, chromium:1133307, chromium:1300509
> Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>

Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I9eccdf065820854746ec7ad4643362859c9960e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3506653
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Owners-Override: Kim-Anh Tran <kimanh@chromium.org>
2022-03-08 13:45:41 +00:00
Kim-Anh Tran 1b596f3b4b Enable synchronization on instrumentation breakpoints
This CL introduces the synchronization point for setting
breakpoints on new scripts using instrumentation breakpoints.

Instrumentation breakpoints will trigger at the first statement
of a newly run script. Afterwards we wait for all resources
that we need to set a breakpoint (if one is cached for that
particular script), set it, and resume.

Note: this will not correctly synchronize the case where we
just opened DevTools or just created a new target, as at this
point some scripts might have started running. For this, we
need to synchronize the Debugger.enable call, which is something
that is left to take care of.

Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-03-08 12:08:41 +00:00
Kateryna Prokopenko bf7b615577 Remove casts to UrlString from SourcesMap.ts
The one remaining cast has to stay as it types the empty string.

Bug: 1299773
Change-Id: I67a400fc9ac26105e067320e96e74bbfe29cf8fc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3468515
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-02-22 15:45:07 +00:00
Kateryna Prokopenko d2d0313dfb Remove some casts to UrlString and move some up the call stack
Bug: 1253323
Change-Id: I7a6d5eb0c67436814c434538df73397c89d2341d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3467974
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-02-17 08:25:14 +00:00
Changhao Han afe5698f1c Always compare changes based on formatted diff and source
Since we record changed line numbers from formatted sources, we should
always compare formatted current line number against the changed line
numbers. This CL also retrieves the formatted mapping from the diff call
site and stores it for said comparison.

Bug: chromium:1268754
Change-Id: I9f0bdd7f081b17d15a1f80ce788de54defb6717b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3466037
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2022-02-16 11:34:12 +00:00
Kateryna Prokopenko 9d068e57a8 Remove some casts to UrlString and move some up the call stack
Bug: 1253323
Change-Id: Idb5150deabffe26a8c21987a55206729b3781655
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3423898
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-02-16 09:08:28 +00:00
Jaroslav Sevcik 0ee4cd1f42 Move scope names resolver to models
The patch makes the resolver usable by the console.
There should be no functional changes.

Bug: chromium:1297047
Change-Id: I020375c4c5587d1053a801dbf1b9c6a850e367aa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3461555
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-02-15 21:40:01 +00:00
Kateryna Prokopenko edc0dd1509 Remove casts to UrlString from DebuggerModel
Bug: 1253323
Change-Id: Ib661c2dd62350cbcdb10c39bbb977881084cb8c9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3420334
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-02-15 13:20:17 +00:00
Changhao Han 6509c35f86 Add copy all changes to the Styles pane
Screencast: https://imgur.com/a/s98Bjwn

Design doc: https://docs.google.com/document/d/1jj9I7ANHh06tbCG6TtcZzd7vqa7hoQNWhOBSku5hKjA/edit

Architecture doc: https://docs.google.com/document/d/1zkOWg1OlUYudFjgqMFvZy1HuOCcrHUFho55q94MowtM/

Bug: chromium:1268754
Change-Id: I85c6b5ef75071193b3e32612bc75a1fbb32ab85a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3455486
Reviewed-by: Johan Bay <jobay@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2022-02-14 17:17:19 +00:00
Simon Zünd 72eb091458 [cleanup] Turn 'Project' into a true interface
This CL changes 'Project' from an abstract class into an interface
and makes 'ProjectStore' an abstract base class instead. This removes
the awkward usage of an abstract class in an "implements" clause as
well as the awkward cast of 'this' to 'Project' inside 'ProjectStore'.

R=kimanh@chromium.org

Bug: 1290254
Change-Id: I9a2617557dc02743f4fe0c5c965dc9ea6bf7e675
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3423904
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-01-31 15:00:39 +00:00
Mathias Bynens cf84f8dd57 Clean up redundant Promise.resolve() in ContentProviderBasedProject
Relevant typescript-eslint issue:
https://github.com/typescript-eslint/typescript-eslint/issues/4500

Bug: chromium:1161501
Change-Id: I7d3ef6abec7a93326040e183098e1a9c84660977
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3427063
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2022-01-31 13:50:59 +00:00
Tim van der Lippe 2d9a95ce7b Suppress all existing promise races
To suppress the races, we mark these invocations with `void` per
the instructions of `no-floating-promises`. This explicitly marks
these statements as side-effect promises.

Engineers can later analyze these void statements and determine
whether the promise races are intentional or accidental.

R=jacktfranklin@chromium.org

Bug: 1239617
Change-Id: I6b7a24cf21029d6ff73b112b3e8255ebab8c60ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3366467
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-04 16:08:08 +00:00
Jaroslav Sevcik 85adef796f Fix handling of asynchronously removed location
This fixes a bug where SourcePanel.executionLineChanged can revive stale
source code if `await liveLocation.uiLocation()` gets pre-empted by
deleting the source code.

This can happen on a reload of a page with a source mapped JavaScript
file while the execution is stopped in that JavaScript file. When
resetting the DebuggerModel, we first detach source maps. The detach
handler will schedule execution line update (among other things).  Then
the scripts are removed. Once the scheduled execution line update runs,
it will revive the source code with the execution line in
TabbedEditorContainer. When/if the script is actually loaded by the VM,
the front-end will then incorrectly skip loading the script contents
from the VM because its content is already present in
TabbedEditorContainer.  As a result, if the newly run script had
different content it won't be reflected in the source panel.

This patch solves the problem by skipping the execution line update
logic if the execution line location got discarded in the meantime.

Bug: chromium:508270
Change-Id: I338e5fda0b43edf8537d7eceea14940c9fa33238
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3365271
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-01-04 12:24:17 +00:00
Kim-Anh Tran c78916cb42 Restructure scheduleUpdateInDebugger to allow for awaiting it
This CL restructures scheduleUpdateInDebugger to allow callers
to await the update. In follow up changes we will
need to properly await scheduleUpdateInDebugger to make sure
that an update (setting the breakpoint) has happened before
we can continue execution. Specifically, this is relevant
in scenarios in which we stop execution (e.g. through
instrumentation breakpoints) to make sure that all breakpoints
are set, before allowing the execution to continue.

Bug: chromium:1133307, chromium:1229541
Change-Id: I3ef2103ff03aaa02503a680b190c2d46148448de
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3361035
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-01-04 11:55:16 +00:00
Yang Guo 5344c971e3 Fix skip range computation for step out case
R=bmeurer@chromium.org

Fixed: 1283188
Change-Id: I920484a07059b7448d39f8238ae78b73e7ecd330
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3360657
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2021-12-29 15:33:41 +00:00
Simon Zünd 100452a87a [cleanup] Remove unnecessary @interface comments
The CL only removes occurrences in non *-legacy.ts files.

R=tvanderlippe@chromium.org

Bug: None
Change-Id: Iaa964e04319a2fdc4635ddfcc6731d2c9e2d4b1b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3338346
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2021-12-14 13:19:50 +00:00
Simon Zünd fe7a0d52a9 [cleanup] Remove unnecessary Closure-style casts
R=tvanderlippe@chromium.org

Bug: None
Change-Id: Ie15c5caaf048023c6a1d8077f91f1a0e5864b7af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3334539
Commit-Queue: Simon Zünd <szuend@chromium.org>
Auto-Submit: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2021-12-13 10:31:14 +00:00
Tim van der Lippe 4f11084e0d Enable no-unused-private-class-members
With ESLint 8, we can now report unused private class fields. By
enabling this rule, we also found numerous unused fields in our models
and panels, which this CL deletes as well.

R=jacktfranklin@chromium.org

Bug: none
Change-Id: I98fef678fd26c06e67d1d8678e9f8f259355940a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3310610
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-12-01 15:29:06 +00:00
Wolfgang Beyer 433f4ebd99 Make methods public so that they can be called from blink tests
BE CL: https://crrev.com/c/3298808

Bug: 1094436
Change-Id: I7b411e83a2226a899beccb351b28ab6ad275d267
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3298827
Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2021-11-29 11:00:05 +00:00
Kateryna Prokopenko cae13bb94a Remove all DevToolsPath types as some of them might be incorrect
In order to avoid additional difficulties when typing paths in DevTools
discard the previous (possibly incorrect).

Bug: 1253323
Change-Id: Id4076900a44e9f06440cbfb4b99bed90f1ceb1f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3297832
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2021-11-24 08:51:25 +00:00
Benedikt Meurer a992c9dfc6 Remove position adjustment for inline scripts with #sourceURL.
Following up on https://crrev.com/c/3069289 the back-end reports
positions (raw locations) for inline scripts with `//# sourceURL`
annotations relative to the start of the <script> tag content, rather
than relative to the surrounding document.

The DevTools front-end however was still trying to make up for the
wrong positions reported by the back-end, leading to negative line
numbers being reported and sometimes jumping to the wrong line when
using inline scripts with `//# sourceURL` annotations.

This change removes the hacks from the front-end and simply uses the
positions from the back-end, which are now correct.

Fixed: chromium:1270227
Bug: chromium:578269, chromium:1183990
Change-Id: I65a59f64f42230179f56218518e727116329ad5d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291151
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-11-22 07:01:30 +00:00
Kateryna Prokopenko 6b831e3f67 Retype incorrect types from UrlString to RawPathString
Bug: 1253323
Change-Id: Ie1c0504db44583b39d3c9df4cb971e573f6d332f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3229762
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2021-10-19 09:36:51 +00:00
Kateryna Prokopenko 0623fac554 Remove casts to UrlString from PersistenceAction
Bug: 1253323
Change-Id: I09531fb20ad71c3bd4ffa79ca829d26afedd8f84
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3222665
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-10-14 12:53:56 +00:00
Kateryna Prokopenko 4a2432a25c Remove casts to UrlString from DebuggerModel
Bug: 1253323
Change-Id: I225cf34a088f492e1465f3a451bcdf7489ebcc58
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3220640
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-10-14 10:07:28 +00:00
Tim van der Lippe 113abecd98 Reland "Migrate to private class fields in models/bindings"
This reverts commit 550eb43d4e.

Reason for revert: Fixed layout test

Original change's description:
> Revert "Migrate to private class fields in models/bindings"
>
> This reverts commit bad24493c9.
>
> Reason for revert: layout test causing autoroll failures: https://crrev.com/c/3218502
>
> Original change's description:
> > Migrate to private class fields in models/bindings
> >
> > R=​szuend@chromium.org
> >
> > Bug: 1222126
> > Change-Id: I3a6fbea503d3c0fded7208109e0d2b52b1159516
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3207879
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> > Reviewed-by: Simon Zünd <szuend@chromium.org>
>
> Bug: 1222126
> Change-Id: I47dd7e76d749c8f6503955f23ee9b5e452382ffb
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3218891
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>

Bug: 1222126
Change-Id: I80a7a70264de8236b8da860ff2ecc05b7ae32a85
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3218075
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-10-12 12:44:28 +00:00
Jack Franklin 550eb43d4e Revert "Migrate to private class fields in models/bindings"
This reverts commit bad24493c9.

Reason for revert: layout test causing autoroll failures: https://crrev.com/c/3218502

Original change's description:
> Migrate to private class fields in models/bindings
>
> R=​szuend@chromium.org
>
> Bug: 1222126
> Change-Id: I3a6fbea503d3c0fded7208109e0d2b52b1159516
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3207879
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

Bug: 1222126
Change-Id: I47dd7e76d749c8f6503955f23ee9b5e452382ffb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3218891
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-10-12 09:14:00 +00:00
Tim van der Lippe bad24493c9 Migrate to private class fields in models/bindings
R=szuend@chromium.org

Bug: 1222126
Change-Id: I3a6fbea503d3c0fded7208109e0d2b52b1159516
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3207879
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-10-11 15:01:49 +00:00
Benedikt Meurer 20de1e3e2b [cleanup] Remove the 'Empty sourcemap auto-stepping' experiment.
With https://crrev.com/c/3172834 we previously aligned the stepping
behavior of sourcemaps (both JavaScript and WebAssembly) with that
of DWARF (WebAssembly only), but we still gated that adjustment
behind the 'Empty sourcemap auto-stepping' experiment.

This enables the aligned behavior by default and removes the (confusing)
and according to usage metrics almost completely unused experiment.

Bug: chromium:1232347
Change-Id: Idfa62a2cfa337d4ced3486baa3249cb95a8d8c16
Fixed: chromium:1018234
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3197720
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@google.com>
2021-10-01 17:56:31 +00:00
Jaroslav Sevcik 33293f95a5 Reland "Improve stepping with source maps"
This reverts commit a09263601b.

This change did not cause the original breakage, so we are relanding
the original CL as is.

Original change's description:
> Improve stepping with source maps
>
> This aligns stepping through source maps with stepping through
> Wasm+Dwarf: when stepping from a location, we lookup the corresponding
> source location and then make sure we skip all the raw/compiled
> locations that correspond to that source location.
>
> To implement the skipping, we reuse the skipList mechanism that is
> already used for stepping through Wasm+Dwarf.
>
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3093161

Bug: crbug.com/1232347
Change-Id: Ibe83e035aea73f070949902051dd8f100dde6f32
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3172834
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2021-09-22 07:37:24 +00:00
Simon Zünd a2c7306783 Use type-safe events for resolving breakpoints
R=pfaffe@chromium.org

Bug: 1228674
Change-Id: I0cd83ee336245ce26935890a30559f4c1e1a74c5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3171017
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2021-09-20 09:36:29 +00:00
Benedikt Meurer 60a9d6b7c9 Use type-safe events for ResourceScriptMapping.
Also remove the unused UISourceCode that was sent with these events.

Bug: chromium:1228647, chromium:1167717
Change-Id: I879156e736098d7f4817927244fc9e492b862e52
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3151797
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-09-09 17:09:47 +00:00
Kateryna Prokopenko d390274a6b Use type-safe events for ComputedStyleModel
Bug: 1228674
Change-Id: If8abc62f933cf678f729d65546c920a40da419f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3122344
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@google.com>
2021-09-09 09:50:37 +00:00
Ella Ge a09263601b Revert "Improve stepping with source maps"
This reverts commit 37810de6de.

Reason for revert: Suspect causing test failures: crbug/1244616

Original change's description:
> Improve stepping with source maps
>
> This aligns stepping through source maps with stepping through
> Wasm+Dwarf: when stepping from a location, we lookup the corresponding
> source location and then make sure we skip all the raw/compiled
> locations that correspond to that source location.
>
> To implement the skipping, we reuse the skipList mechanism that is
> already used for stepping through Wasm+Dwarf.
>
> Bug: crbug.com/1232347
> Change-Id: Ib19695b2078256282189df5b10d9165633849799
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3093161
> Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
> Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
> Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>

Bug: crbug.com/1232347 crbug.com/1244616
Change-Id: Ie38ae7e603dff7d951c79b8c590ed27d31023c0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3128964
Auto-Submit: Ella Ge <eirage@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-08-30 15:54:25 +00:00
Jaroslav Sevcik 37810de6de Improve stepping with source maps
This aligns stepping through source maps with stepping through
Wasm+Dwarf: when stepping from a location, we lookup the corresponding
source location and then make sure we skip all the raw/compiled
locations that correspond to that source location.

To implement the skipping, we reuse the skipList mechanism that is
already used for stepping through Wasm+Dwarf.

Bug: crbug.com/1232347
Change-Id: Ib19695b2078256282189df5b10d9165633849799
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3093161
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-08-30 11:29:04 +00:00
Kateryna Prokopenko 78c1622b0e Use type-safe events for NetworkProject
Bug: 1228674
Change-Id: Ic998d7290511284556d401a58bdaa9d129ac1060
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3122651
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@google.com>
2021-08-27 07:21:17 +00:00