Commit Graph
4 Commits
Author SHA1 Message Date
Simon Zünd 35f8d67915 Replace 'requestContent' with 'requestContentData' in most unit tests
Now that every ContentProvider is actually a SafeContentProvider, we
can start migrating to the safer API.

R=pfaffe@chromium.org

Bug: 342529015
Change-Id: I7b3ce53846bb85d447f0a707409235814bed9661
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5578160
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2024-05-31 06:58:39 +00:00
Benedikt Meurer 2f0c431ebb [cleanup] Remove ScopeTreeCache singleton.
This simplifies the `ScopeTreeCache` module and removes the unnecessary
singleton. Instead there's now just a single WeakMap from scripts to
promises.

Bug: chromium:1457874, chromium:1379221
Change-Id: I999c7570a605654763f0c2c660a3edfef66830b9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5104774
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
2023-12-11 07:32:01 +00:00
Simon Zünd 4440dd0eae [scopes] Parse full script when collecting identifiers for a scope
This CL changes the scope source map variable resolving mechanism
to use the full scope tree of the underlying compiled script.

Currently we look for the surrounding function scope and try to turn
it into a valid script that Acorn understands.
This can fail in some instances. E.g. if we pause in
a class method that uses private fields, then Acorn expects a
surrounding class scope that actually declares these private fields.

Using the full scope tree fixes this issue. It also prevents
unnecessary re-parses since we cache the full scope tree for each
script. Currently we only cache based on call frames. This means
we currently re-parse for each pause during stepping.

Moreover, the full scope tree is a pre-requisite for source mapped
variables in breakpoint conditions.

R=jarin@chormium.org

Bug: 1457874
Change-Id: I4e1e3de47920db6c72cebd4c2ff3fd988461b6c1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4650348
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
2023-06-28 07:05:35 +00:00
Simon Zünd 5d1603a5d2 [scopes] Add ScopeTreeCache class
This CL adds cache for scope trees keyed on scripts. We use
SDK.Script for the key, which boils down to model + script ID.

The cache is necessary since we want to switch over to use the full
scope tree of scripts, and not just parse single functions.

A follow-up CL will hook the cache up to NameResolver.ts.

Bug: 1457874
Change-Id: If79ff59f2cd1fdbce8b7a6a048a9e5ef876583b8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4647594
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
2023-06-27 10:59:05 +00:00