Commit Graph
37 Commits
Author SHA1 Message Date
Benedikt Meurer ae824e6ff5 [bindings] Introduce uiLocationRangeToRawLocationRanges().
This introduces a new uiLocationRangeToRawLocationRanges() method to the mapping layer which will be used by possibleBreakpoints() in the
BreakpointManager in the future to determine the set of raw location
ranges within which to ask V8 for breakable locations.

The new uiLocationRangeToLocationRanges() takes into account even
special cases like holes that can result from funny source maps, and in
the future should also be useful to compute the skip ranges for the
auto-stepping logic.

For the SourceFormatter ScriptMapping we kept the assumption that the
ranges must be contiguous even though they don't necessarily are (for
formatted documents with inline scripts), but the whole SourceFormatter
functionality is basically deprecated at this point and will soon be
removed (in-place pretty printing was enabled by default with M-111
already).

Bug: chromium:1409365
Change-Id: I3ec7db0ad32272a0af96c2c06f8506d4886bbe9e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4196922
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2023-01-30 11:47:19 +00:00
Benedikt Meurer 41e852dd83 [cleanup] Remove redundant ScriptPosition and LocationRange types.
These classes were basically 1:1 wrappers around the protocol types, and
there's no reason to have them as separate classes as well. It just
makes things unnecessarily challenging to understand (because it isn't
immediately obvious what the difference is) and harder to reason about.

Also rename the RawLocationRange to LocationRange now and use that type
in the appropriate places.

Bug: chromium:1409365
Change-Id: I9ce5a3c272c5592a4ee9322fcdbf07832bae7063
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4196914
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2023-01-26 12:38:01 +00:00
Benedikt Meurer 38f864da9f [cleanup] Remove initiator from SourceMaps.
The fact that sourcemaps know about initiators presents a layering
violation and hiding the logic to request source contents within
the `SourceMap` class makes it difficult to tackle the problem of
dealing with resources that fail to load.

Drive-by-fix: Also remove i18n from the source map error messages. We
currently translate only a few of the errors, which leads to a quite
inconsistent experience; it's better to not translate them at all for
now (especially since we have no control over the error text that comes
out of JSON.parse() for example).

Bug: chromium:1262113
Change-Id: I45df23b99e2fc3d42a47e3999df4ab8d75b54541
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4161383
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-01-15 10:34:15 +00:00
Benedikt Meurer ec1cb274d9 [bindings] Refactor computation of mapped lines for sources.
This introduces a new `getMappedLines()` method on the debugger
workspace binding, which consults the appropriate methods in the
debugger plugins, as well as the mappings, to compute the set of
lines that map to scripts (for the breakpoint line gutter).

With this CL we now properly indicate the script lines within
HTML documents, and we also remove one of the two last remaining
static methods on the `CompilerScriptMapping`.

Note that even with this refactoring, we are still lying about
breakable lines in the breakpoint gutter, since just because a
line is mapped to a script doesn't necessarily mean that it's
possible to set a breakpoint on this line. Fixing this will need
a combination of the mapped lines information with information
about possible breakpoints from V8.

Bug: chromium:1185770
Change-Id: Ie8481df799d3986a24caea5117a884c2a1cd0433
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4161371
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
2023-01-12 08:28:38 +00:00
Benedikt Meurer 7eacefe5ac [cleanup] Fix the ProjectStore.uiSourceCodes() foot-gun.
Previously `ProjectStore.uiSourceCodes()` was implemented to return an
internal array of `UISourceCode`s that was mutated as sources got added
and removed from the project. This led to subtle bugs when removing
sources from a project by just iterating over this array, where because
of the funny compaction logic the iterator would skip over items and
miss them.

The internal implementation of this is also unnecessary complex by using
both a Map and an Array. We can drastically simplify this by simply only
using the Map and having `ProjectStore.uiSourceCodes()` return an
iterable that adheres to the `Map#values()` rules, and in particular is
safe to use while removing items from the store.

Bug: chromium:1406449
Change-Id: I751126906357c5e27f08c3bf7a6e278094d801d1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4154491
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-01-11 11:15:17 +00:00
Benedikt Meurer bba8a16971 [cleanup] Simplify ContentProviderBasedProject usage.
This simplifies the implementation and usage of the
ContentProviderBasedProject, such that:

1. There's only a single internal mapping from UISourceCode to
   content provider, mime type, and metadata, instead of having
   two separate mappings.
2. Due to the first simplification we no longer need to have the
   dedicated removeFile() method, which basically just calls through to
   removeUISourceCode(), but additionally also maintained the separate
   content provider mapping (this was a bit of a bug farm and I hit this
   multiple times during the past 3 years).
3. Inside removeUISourceCode() there's no need to perform the
   UISourceCode lookup two times.

Bug: none
Change-Id: I4560893cf0729a153ee4a7d7e4de904b8619898f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4154490
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-01-11 08:56:09 +00:00
Benedikt Meurer 92209845c7 [bindings] Fix handling of conflicting source maps.
This basically adds proper support for "hot module replacement" to
the `CompilerScriptMapping` by resolving conflicts between source maps
within the same target using the following strategy:

1. If two source maps from different scripts reference the same authored
   file, and neither of the source maps provides content for the file
   and agree on the ignore-list hint, we consider this to be the same
   authored file.
2. If two source maps from different scripts reference the same authored
   file, and both source maps carry the same `sourcesContent` for the
   file and agree on the ignore-list hint, we consider this to be the
   same authored file.
3. In all other cases we assume that there is a conflict, and we further
   assume that the intention here is to replace the authored file with a
   newer version (via "hot module replacement"). We therefore unlink
   the previous `UISourceCode` for the authored file and mark all
   mappings from earlier source maps to this `UISourceCode` as stale,
   meaning that future attempts to resolve the mapped locations from the
   associated scripts will not find a `UISourceCode` coming from the
   `CompilerScriptMapping` (but will fall back to the default mappings).

The "stale source map" case is especially interesting, since we need to
ensure that not only UI to raw location lookups will ignore stale
UISourceCodes, but also when mapping raw to UI locations, we need to
double check that the UISourceCode we find is still active for the
source map associated with the script.

Drive-by-fix: Add documentation and more test cases for this
functionality.

Doc: http://go/devtools-source-identities
Doc: http://go/chrome-devtools:web-starter-kit-2022-investigation
Fixed: chromium:1403432, chromium:1404703
Bug: chromium:1403362, chromium:1069378
Change-Id: Ic54043e4c6d6ca703bdcec6d300e282518503c41
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4128466
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
2023-01-09 08:33:58 +00:00
Benedikt Meurer 2379762d89 [sourcemaps] Fix sourcemaps for inline scripts with sourceURLs.
When resolving locations in inline <script>s with `//# sourceURL`
annotations we must not add the line/column offsets.

Fixed: chromium:1405134
Change-Id: If600f547a9687e4517c16d8f58d14f27758b9277
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4136099
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
2023-01-05 20:47:54 +00:00
Benedikt Meurer 396d4cd4be [cleanup] Properly update live locations of inline scripts and styles.
The fix in https://crrev.com/c/2742490 put the logic for updating the
live locations of inline scripts into the wrong place, and also did not
perform the live location update for inline styles. It was the wrong
place because the CompilerScriptMapping is concerned with sourcemap
related UISourceCodes, whereas the ResourceMapping is responsible for
documents (with inline scripts and styles). The previous fix worked by
chance due to a specific order of events for scripts.

This patch puts the logic into the correct spot, and extends it to also
update the locations for inline styles once the document is loaded.

Bug: chromium:1184162, chromium:1403432
Change-Id: I659bc8899b8b2cec03f9fd225648c6d305194694
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4127779
Reviewed-by: Andres Olivares <andoli@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2022-12-29 09:12:53 +00:00
Benedikt Meurer c29493c721 [cleanup] Remove unnecessary script->sourcemap indirections.
Following up on https://crrev.com/c/4120261 we can further simplify the
mapping of scripts to sourcemaps and avoid a couple of unnecessary
indirections here (which also violate the layering).

Bug: chromium:508270, chromium:1403362, chromium:1403432
Change-Id: I6c8cac3de08a8565cb10ac7c9970c81e6d154ff4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4127778
Commit-Queue: Andres Olivares <andoli@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
2022-12-29 08:41:21 +00:00
Benedikt Meurer f8065273e0 [sdk] Remove unsound caching from the SourceMapManager.
The SourceMapManager was trying to cache sourcemaps by their "source map
id", which was basically the concatenation of sourceURL (of the client)
and sourceMappingURL (of the sourcemap). This caching is unsound by
itself, since the content of both the client and the sourcemap can
change without changing their URLs. So there was already quite a bit of
ducktape on top (in DebuggerModel) to forcibly detach sourcemaps when
there it would detect a clash (based on execution ID, sourceURL and
sourceMappingURL). But even this ducktape still left plenty of ways open
in which a stale sourcemap could be fetched from this cache (one of the
easy ways to reproduce is demonstrated in https://crbug.com/1403362).

One alternative how to go about this would be to also include the client
content hash into the mix (i.e. the script hash for JavaScript). But
right now we don't have the hash available for the stylesheet contents,
and even if we did, it wouldn't fix the fundmental problem either, since
the sourcemap (and sources) can change while still producing the exact
same bundle in case of both JavaScript and CSS.

So the appropriate solution is to remove this caching layer and instead
rely on Chrome's caching for sourcemaps (parsing sourcemaps is fairly
cheap on common developer hardware, so that's a complete non-issue).
This CL thus drastically simplifies the SourceMapManager and adds a
significant chunk of test coverage for the interesting behaviors.
Specifically this means now that there's a 1:1 mapping between
sourcemaps and clients, rather than this strange 1:N mapping that we
used to have before (which would almost never trigger except when it
shouldn't).

Drive-by-fix: Remove i18n from the SourceMapManager, as this is a
layering violation and we generally don't localize internal error
messages (like the warn() call in SourceMap.ts is not localized either).

Fixed: chromium:508270, chromium:1403362
Change-Id: I2c7d29635ba085c433bdb3cc691f720e9c158808
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4120261
Reviewed-by: Yang Guo <yangguo@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2022-12-23 12:47:53 +00:00
Eric Leese c010ce7baa Experiment to hide ignore listed code in source tree
Bug: 1336604
Change-Id: I633390a187986376b71e9f1a27989be66bfb70c5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3785005
Reviewed-by: Victor Porof <victorporof@chromium.org>
Commit-Queue: Victor Porof <victorporof@chromium.org>
2022-08-02 07:12:04 +00:00
Victor Porof aeef8d7c88 Automatically ignore-list code based on source map hints
This CL affects V8 blackboxing on the backend, and the presentation of call frames in the Call Stack sidebar pane on the frontend.

The situations in which ignore-listing will affect the UI on the frontend will be consolidated in separate CLs.

Bug: 1323199
Change-Id: I4afe69ca9eaa0d6b15bf365fb57baa5acb741fa6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3762474
Commit-Queue: Victor Porof <victorporof@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
2022-07-20 14:35:34 +00:00
Jack Franklin 3a80260722 Inline type imports in front_end
This CL enables the `inline_type_imports` rule for devtools-frontend,
and is the result of running the auto-fixer to update all imports
accordingly.

Bug: 1319340
Change-Id: I303256476fd4e94f4505bbf4355c0070ac101aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3752799
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-07-13 09:26:00 +00:00
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
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 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 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
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
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
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
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
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
Benedikt Meurer bb1c7f143a Use type-safe events for SourceMapManager.
Bug: chromium:1228674
Change-Id: Ie68584fe93897fa71ba5702ff017251a2125333e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3109528
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2021-08-23 10:38:48 +00:00
Sigurd Schneider 19b55237a3 Type annotate with Page.FrameId consistently
DISABLE_THIRD_PARTY_CHECK=disable

Bug: chromium:1226471
Change-Id: I76ece085a7e448558f1f2553179c42b1188888d6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3083710
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-13 17:28:44 +00:00
Kateryna Prokopenko 799d1e2b59 Use type-safe events for WorkSpaceImpl
Bug: 1228674
Change-Id: Ib3a67154c3933df4f840a20a77f20d7f42bc046f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3090971
Commit-Queue: Kateryna Prokopenko <kprokopenko@google.com>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-08-13 06:59:25 +00:00
Jan Scheffler 085122e946 [Underscore Migration] Migrate models/bindings
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

Bug:chromium:1207342
Change-Id: I26928144c6ade2c1494c81920c63b5e5ea9c7ade
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3077888
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-07 09:02:45 +00:00
Tim van der Lippe 877f04aa0e Remove eslint-disable statements from type imports
We no longer use the no-unused-vars and instead use the version
of typescript-eslint. The latter can properly detect unused
type-import usages. Therefore, we can remove the eslint-disable
statements, which are essentially noops.

This CL is the result of replacing

```
import type (.*) // eslint-disable-line no-unused-vars
```

with

```
import type $1
```

R=jacktfranklin@chromium.org

Bug: none
Change-Id: I141edcb7125e414c405760af1e4058bfdc6e30f3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3048473
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-07-26 12:53:27 +00:00
Simon Zünd 735921cd29 [cleanup] Move removeEventListeners off EventTarget
removeEventListeners is already an exported function. Removing
the static method from `EventTarget` allows us to make `EventTarget`
a true interface.

Bug: 1228674
Change-Id: I8a870edc90438f6556b08f3329df6b2f850be297
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978375
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2021-07-13 12:33:35 +00:00
Jack Franklin a75ae7cbb3 Enforce import type when importing TS types.
Bug: none
Change-Id: I02ef1182143b7fe091ce92d59f04ac2188903e0d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2886925
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-05-11 14:00:22 +00:00
Tim van der Lippe 99aeaf3724 Move workspace to models/workspace
R=jacktfranklin@chromium.org

No-Presubmit: true
Bug: 1187573
Change-Id: Ia4bf7cb736dca976fb30d9e94beeda3e28115dce
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2815118
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-04-09 15:32:33 +00:00
Tim van der Lippe fca98ed75d Move text_utils to models/text_utils
R=jacktfranklin@chromium.org

No-Presubmit: true
Bug: 1187573
Change-Id: I53965f7fac3f0f932ebb73fb0e38d28831451532
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2815016
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-04-08 16:07:22 +00:00
Tim van der Lippe 959b6f067a Move bindings to models/bindings
R=jacktfranklin@chromium.org

No-Presubmit: true
Bug: 1187573
Change-Id: I48168f92899d652980df36cc15475da988f760c5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2810278
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-04-07 10:03:50 +00:00