Closed Bug 1815500 Opened 3 years ago Closed 2 years ago

Pass source and sourceActor objects in location objects.

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox113 fixed)

RESOLVED FIXED
113 Branch
Tracking Status
firefox113 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

Attachments

(3 files, 1 obsolete file)

For now, we only pass the sourceId and sourceActorId.
But in most callsites we actually have the source and source actor objects in scope.
Then, in many places where we use the location object we do lookup for objects per IDs.
We could avoid these unecesary computations by passing these objects which are immutable.

https://searchfox.org/mozilla-central/search?q=getSource.*location.source.*Id&path=devtools%2F&case=true&regexp=true

This will help then craft a location with source and sourceActor objects from selectSource.

I migrated the unique usage of this method passing a location to selectSpecificLocation
as selectSource is mostly meant to avoid having to think about/create a location object.

This may keep running async code whose source have been removed,
but this help remove various selectors lookups.

If we expect to check in async code if the source is still registered,
we should probably have an explicit API for this.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

We were missing a few places around SourceMapLoader which creates location objects
without using debugger's createLocation helper. This doesn't help ensure all location are the same.

This will later be useful to assert that all location have source/sourceActor attributes.

Attachment #9316794 - Attachment description: Bug 1815500 - [devtools] Migrate location to convey source and sourceActor objects → Bug 1815500 - [devtools] Migrate location to convey source and sourceActor objects.
No longer depends on: 1818494

Comment on attachment 9316795 [details]
Bug 1815500 - [devtools] Use location source and sourceActor attribute instead of re-querying the selectors.

Revision D169331 was moved to bug 1818495. Setting attachment 9316795 [details] to obsolete.

Attachment #9316795 - Attachment is obsolete: true
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3e0f3e8d355e [devtools] Migrate `selectSource` action to receive source and sourceActor objects. r=bomsy,devtools-reviewers https://hg.mozilla.org/integration/autoland/rev/a272accd0045 [devtools] Ensure using createLocation in all places where we create a location. r=bomsy,perftest-reviewers,devtools-reviewers,AlexandruIonescu https://hg.mozilla.org/integration/autoland/rev/a0cb36e2d903 [devtools] Migrate location to convey source and sourceActor objects. r=bomsy,perftest-reviewers,devtools-reviewers,kshampur
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 113 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: