Open Bug 1495856 Opened 7 years ago Updated 3 years ago

Expose getCachedFront on RootFront (as TargetMixin.getCachedFront)

Categories

(DevTools :: Framework, enhancement, P3)

enhancement

Tracking

(Not tracked)

REOPENED

People

(Reporter: ochameau, Unassigned)

References

(Blocks 1 open bug)

Details

Bug 1222047 introduced a regression where we no longer reset preferences being set by the toolbox on toolbox close, but only once its client is destroyed. It prevented this code from being called: https://searchfox.org/mozilla-central/rev/6ddb5fb144993fb5de044e2e8d900d7643b98a4d/devtools/client/framework/toolbox.js#3074-3078 Luca submitted a patch in bug 1299001 to mitigate that, but we should probably expose an API on target to retrieve fronts only if they were already created! So that on toolbox destroy, we could call this API instead of having to manually store any reference of the preference front.
Severity: normal → enhancement
Priority: -- → P2
Assignee: nobody → ystartsev
Whiteboard: dt-fission
This was partially addressed by for targets: https://bugzilla.mozilla.org/show_bug.cgi?id=1508660 We can add the same solution for global fronts as needed.

This is done. ah wrong bug

Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Priority: P2 → P3
Whiteboard: dt-fission → dt-fission-reserve
Whiteboard: dt-fission-reserve

All targets got a getCachedTarget method exposed as part of bug 1508660.
But it would be nice to also introduce this API onto RootFront:
https://searchfox.org/mozilla-central/rev/d061ba55ac76f41129618d638f4ef674303ec103/devtools/shared/fronts/targets/target-mixin.js#217

As RootFront also exposes getFront and you would easily imagine that both Targets and RootFronts would expose the exact same API:
https://searchfox.org/mozilla-central/rev/d061ba55ac76f41129618d638f4ef674303ec103/devtools/shared/fronts/root.js#429-445

Assignee: ystartsev → nobody
Summary: Introduce an API next to Target.getFront and RootClient.getFront to retrieve front that already exists → Expose getCachedFront on RootFront (as TargetMixin.getCachedFront)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.