Closed Bug 1522573 Opened 5 years ago Closed 2 years ago

Better align target front class and their base target class

Categories

(DevTools :: Framework, enhancement, P3)

enhancement

Tracking

(Fission Milestone:Future)

RESOLVED DUPLICATE of bug 1740292
Fission Milestone Future

People

(Reporter: ochameau, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-fission-future)

This bug is to followup on many comments from Julian from bug 1503628 review, most of them are about how to better align these classes (target fronts) with their base class (Target):
https://phabricator.services.mozilla.com/D15831

  • Subclasses seem to consistently implement:
    • attach
    • detach (missing in content-process for now)
    • attachThread
    • reconfigure
      It would be nice to either have the information in the description of the mixin or (better in my opinion) add abstract implementations in the mixin eg
attach() {
  throw new Error("attach should be overridden by the TargetMixin subclass");
}

We also expect this.targetForm to be set by the subclass. So similarly a get targetForm() { throw ... } could be nice here.

  • follow up: we should consistently use this._tab in the mixin

  • follow up: Related to my other comment (about adding abstract methods) why not implement an empty detach in content-process.js, explaining why it is not supported there?

  • We discussed about cleaning this _attach already, but I didn't realize it was cleaned up here. It is slightly weird to clear it here since it's only created in the subclasses. I would prefer cleaning it in the destroy() of each target front, but none of them have a destroy at the moment. So maybe simply a comment pointing out that all subclasses are creating this._attach in their own attach() method?

  • the relationship between destroy and detach is still confusing for me.
    Some examples:

    • target-mixin destroy calls detach in some situations
    • worker-target-front detach calls destroy (which calls target-mixin destroy, which sometimes call detach, but not in this case)
      Overall, if it doesn't make sense to keep detached target fronts around, should we try to merge detach inside of destroy?
Priority: P2 → P3
Whiteboard: dt-fission → dt-fission-reserve

Tracking Fission DevTools bugs for Fission Nightly (M6)

Fission Milestone: --- → M6

dt-fission-reserve bugs do not need to block Fission Nightly (M6).

Fission Milestone: M6 → ---

Tracking dt-fission-reserve bugs for Fission MVP until we know whether they really need to block Fission or not.

Fission Milestone: --- → MVP

Moving old "dt-fission-reserve" bugs to "dt-fission-future" because they don't block Fission MVP.

Fission Milestone: MVP → Future
Whiteboard: dt-fission-reserve → dt-fission-future

I believe bug 1740292 drastically simplified this issues.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.