Closed Bug 1602371 Opened 2 years ago Closed 2 years ago

Simplify DevTools LocalTabTargetFront


(DevTools :: General, task, P3)



(firefox73 fixed)

Firefox 73
Tracking Status
firefox73 --- fixed


(Reporter: jdescottes, Assigned: jdescottes)




(3 files)

I was reviewing the current responsibilities of LocalTabTargetFront in scope of Bug 1579042.

It handles:

  • tab events
    • TabClose
    • TabRemotenessChange
    • unload
  • local tab getters
    • tab
    • isLocalTab
    • csp
    • contentPrincipal

I think we should try to move most of this to the server. Once we have a TabDescriptorActor in Bug 1579042, it will be the ideal spot to listen to tab events, since it will also run in the parent process. We might keep them in the TabDescriptorFront in a first step, but those events really belong in the server.

In this bug I would like to try some preliminary cleanups:

  • remove the "unload" event. This listener is not really documented, it's not clear why we should destroy the target front here?
  • remove the csp & contentPrincipal getters. They are only used in one callsite which already has a pointer to the tab
  • rename the tab getter to localTab to make is easier to search (and maybe try to remove a few call sites)

It is not clear why tab unload should be listened to on the client, and only destroy the target front.
Tentatively removing to simplify the local tab target.

Depends on D56327. Not reason to make target-mixin more complex for this workaround which already has access to the tab object.

Depends on D56330

Renaming the "tab" getter to "localTab" will make it easier to refactor later.

Pushed by
Stop listening to tab unload in LocalTabTargetFront r=ochameau
Remove csp and contentPrincipal getters in LocalTabTargetFront r=ochameau
Rename LocalTabTargetFront tab getter to localTab r=ochameau
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 73
You need to log in before you can comment on or make changes to this bug.