Closed Bug 1569690 Opened 3 years ago Closed 3 years ago

Target should be used to fetch any other target scoped front


(DevTools :: Debugger, enhancement, P1)



(firefox70 fixed)

Firefox 70
Tracking Status
firefox70 --- fixed


(Reporter: ochameau, Assigned: ochameau)


(Blocks 1 open bug)


(Whiteboard: dt-fission-m1)


(1 file)

For now, a Map of thread actor ID is being maintainted over here:

        newWorkerClients[] = {
          url: workerTargetFront.url,
          thread: workerThread,
          console: consoleFront,

This clearly replicates the Target fronts and its TargetMixin class. Targets expose url and the getFront method to access any other target scoped front like console, thread, but also the inspector and all other similar fronts.

The current doesn't scale, especially when this pattern escape from the debugger into the console.

By using the thread actor ID as a key in the console:

         const state = this.hud.getDebuggerFrames();

         const grip = state.frames[state.selected];

         return {
            client: this.hud.lookupConsoleClient(grip.thread),

It forces us to have to call some function of the debugger, lookupConsoleClient in order to derivate the console front out of the thread actor ID.

Instead, if the debugger would have passed the target front out of DebuggerPanel.getFrames, we would have more naturally retrieved the console front via target.getFront("console").
The same actually applies to the internals of the debugger. The whole newWorkerClients map could actually be a map of targets.

Assignee: nobody → poirot.alex
Pushed by
Use target instead of thread as greatest common divisor. r=loganfsmyth,nchevobbe
Pushed by
Use target instead of thread as greatest common divisor. r=loganfsmyth,nchevobbe
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 70
Flags: needinfo?(poirot.alex)
Priority: -- → P1
Whiteboard: dt-fission
Whiteboard: dt-fission → dt-fission dt-fission-m1
Whiteboard: dt-fission dt-fission-m1 → dt-fission-m1
You need to log in before you can comment on or make changes to this bug.