Closed Bug 1699493 Opened 2 months ago Closed 1 month ago

Migrate WebExtInspectedWindow front to a command

Categories

(WebExtensions :: Developer Tools, task, P2)

task

Tracking

(Fission Milestone:M7a, firefox89 fixed)

RESOLVED FIXED
89 Branch
Fission Milestone M7a
Tracking Status
firefox89 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

(Whiteboard: dt-fission-m3-mvp)

Attachments

(1 file)

While working on bug 1631451, I ended up having test failures on:
https://searchfox.org/mozilla-central/source/browser/components/extensions/test/browser/browser_ext_devtools_inspectedWindow.js#544-545

  targetsCount = await getTargetActorsCount(tab);
  is(targetsCount, 0, "All targets were removed as toolbox was closed");

because ExtensionParent destroys the current top level target from here:
https://searchfox.org/mozilla-central/source/toolkit/components/extensions/ExtensionParent.jsm#716-719

     this._currentDevToolsTarget.destroy();

More info about how it interacted with my changes related to target and descriptor destruction codepath on phabricator:
https://phabricator.services.mozilla.com/D106835#3536533

Having ExtensionParent and WebExt codebase to be working out of the current top level target front is the beginning of the troubles.
It forces ExtensionParent to involve a quite complex logic to track this target (use watchTargets on toolbox's client and memoize it, while toolbox's targetCommand already memoize the current top target via targetCommand.targetFront).
But instead of tweaking a bit how to maintain the target front, we should rather avoid using it entirely.
Instead we could migrate InspectedWindow front to become a command and only pass the new "commands" object.

For now, we only have one command, the TargetCommand.
I'll use this bug as an opportunity to demonstrate how to migrate some existing front code to a command and also how to implement a new command from scratch.

Depends on: 1699497
Depends on: 1699200
Whiteboard: dt-fission-m3-triage
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P2
Whiteboard: dt-fission-m3-triage → dt-fission-m3-mvp
Fission Milestone: --- → M7a
Fission Milestone: M7a → M8
Fission Milestone: M8 → M7a
Blocks: 1701790
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b725fa7eb45f
[devtools] Migrate WebExtInspectedWindow front to a command. r=nchevobbe,rpl
Regressions: 1702477
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.