Closed Bug 1506546 Opened 6 years ago Closed 6 years ago

Instantiate addon Target via the AddonTargetFront rather than its form

Categories

(DevTools :: Framework, enhancement, P2)

enhancement

Tracking

(firefox65 fixed)

RESOLVED FIXED
Firefox 65
Tracking Status
firefox65 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

Details

(Whiteboard: dt-fission)

Attachments

(7 files)

For now, the Target for the add-on toolboxes are instantiated via the form of the AddonTargetActor.
Instead it should be instantiated via its front, by passing the front as Target constructor argument.

The Front is being instantiated late, within Target.attach:
https://searchfox.org/mozilla-central/source/devtools/client/framework/target.js#585

Instead, callsites creating a Target object should create the front and pass it as Target constructor argument. Then, Target.attach should only call front.attach rather than creating the front.
Ideally, the front should be created by protocol.js automatic marshalling and be returned by RootFront.listAddons.
Assignee: poirot.alex → nobody
Assignee: nobody → poirot.alex
MozReview-Commit-ID: A7JxzO7rhhe
MozReview-Commit-ID: nWTkfbF9qb

Depends on D12574
Adapt to the new returned value of listAddons
and also always call it from RootFront instead of DebuggerClient.
Fix the spec in order to expose reload on the front (it was a miss from a previous patch).

MozReview-Commit-ID: AQ5EOQEqnxX

Depends on D12575
I did a dedicated patch for converting both about:debuggings as it is slightly more
complex as we have to tweak redux data, wrappers, mocks.
This patch also convert a manual "reload" request being done by about:debugging
and instead use protocol.js front to do it.
Also, I moved isLegacyTemporaryExtension to the front as it depends on accessing the form
and it should be better to keep form processing to the fronts, if possible.

MozReview-Commit-ID: 16qZkuCBp9b

Depends on D12576
We were dipatching the "connect" request manually, whereas we should be using
protocol.js specifications. It also help getting rid of another use of "form"
instead of "front"/activeTab in Target class.

MozReview-Commit-ID: IOH4mDprAVL

Depends on D12577
This depends on bug 1507429 as it makes devtools/server/tests/unit/test_addon_events.js permafail.
Depends on: 1507429
MozReview-Commit-ID: ExKMirBQJ3K

Depends on D12578
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/23ad29cb776e
Refactor getAddonActorForId test helper. r=yulia
https://hg.mozilla.org/integration/autoland/rev/7b75250a4f12
Change the spec type of listAddons and accomodate using the front rather than the form. r=yulia
https://hg.mozilla.org/integration/autoland/rev/a293a37483b9
Implement RootFront.getAddon and use it to retrieve a single AddonTargetFront. r=yulia
https://hg.mozilla.org/integration/autoland/rev/7d8e650e25c2
Refactor listAddons call sites. r=yulia
https://hg.mozilla.org/integration/autoland/rev/00fe26234b3d
Refactor about:debuggings. r=yulia,jdescottes
https://hg.mozilla.org/integration/autoland/rev/8972a2f14015
Use protocol.js to fetch WebExtension target actor. r=yulia
https://hg.mozilla.org/integration/autoland/rev/fbe3f2183f32
Remove unused AddonClient module. r=jdescottes
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/67c951597bd9
Refactor getAddonActorForId test helper. r=yulia
https://hg.mozilla.org/integration/autoland/rev/e5fb062f20f8
Change the spec type of listAddons and accomodate using the front rather than the form. r=yulia
https://hg.mozilla.org/integration/autoland/rev/da5ade7a2726
Implement RootFront.getAddon and use it to retrieve a single AddonTargetFront. r=yulia
https://hg.mozilla.org/integration/autoland/rev/abfeab4a1d65
Refactor listAddons call sites. r=yulia
https://hg.mozilla.org/integration/autoland/rev/9abf7054a03e
Refactor about:debuggings. r=yulia,jdescottes
https://hg.mozilla.org/integration/autoland/rev/24751811ee6e
Use protocol.js to fetch WebExtension target actor. r=yulia
https://hg.mozilla.org/integration/autoland/rev/b7c7c49fcaa8
Remove unused AddonClient module. r=jdescottes
Flags: needinfo?(poirot.alex)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: