Closed Bug 1603363 Opened 4 years ago Closed 4 years ago

Make the (new) performance panel support target switching

Categories

(DevTools :: Performance Tools (Profiler/Timeline), enhancement, P1)

enhancement

Tracking

(Fission Milestone:M6, firefox75 fixed)

RESOLVED FIXED
Firefox 75
Fission Milestone M6
Tracking Status
firefox75 --- fixed

People

(Reporter: ochameau, Assigned: daisuke)

References

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(1 file, 1 obsolete file)

Bug 1565263 landed the TargetList API which helps support switching to another target (as well as supporting the additional remote iframe target).
But we should followup in each tool in order to start using this new API.
The very first goal is to:

  • stop memoizing the target/targetFront and may be also the target scoped front (inspector, console, thread, storage, ...). Instead we should use toolbox.targetList.targetFront in order to query for the current top level target front.
  • support target switching by using TargetList.watchTargets. In a first iteration we would only care about the top level target. In order to do so, we can check for the isTopLevel argument being passed to the two callbacks register to watchTargets:
  this._toolbox.targetList.watchTargets([this._toolbox.targetList.TYPES.FRAME],
    ({ type, targetFront, isTopLevel }) => {
      if (isTopLevel) {
        // A new top level target is available
        // This will be fired on toolbox opening, for the first one,
        // And then, evertime we navigate to another process.
        // For now, you would need `devtools.target-switching.enabled` to be set to true
        // And navigate from any http website to about:robots, which loads into the parent process. Or enable Fission and navigate between two distinct top level domains.
      }
    },
    ({ type, targetFront, isTopLevel }) => {
      if (isTopLevel) {
        // A top level target has been destroyed
      }
    }

See bug 1565263 for how we migrated the console or bug 1578242 for the inspector.

We could remove gTarget as it isn't used:
https://searchfox.org/mozilla-central/rev/62a130ba0ac80f75175e4b65536290b52391f116/devtools/client/performance-new/panel.js#59
And would ensure that we do not try to use target-scoped fronts. Which are the things to accomodate regarding target-switching.

Otherwise, as the new performance panel is only using parent process/global actors:
https://searchfox.org/mozilla-central/rev/62a130ba0ac80f75175e4b65536290b52391f116/devtools/client/performance-new/panel.js#61-68
There isn't anything to do in order to make it work when we switch to top level target.

Whiteboard: dt-fission-m2-mvp

Tracking dt-fission-m2 bugs for Fission Nightly (M6)

Fission Milestone: --- → M6
Priority: -- → P2
Assignee: nobody → daisuke
Status: NEW → ASSIGNED

Depends on D62702

Priority: P2 → P1
Attachment #9126334 - Attachment is obsolete: true
Pushed by dakatsuka.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d9783d214791
Get rid of variables that no longer used in new performance panel. r=jdescottes,julienw
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 75
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: