Closed Bug 1602371 Opened 5 years ago Closed 5 years ago

Simplify DevTools LocalTabTargetFront

Categories

(DevTools :: General, task, P3)

task

Tracking

(firefox73 fixed)

RESOLVED FIXED
Firefox 73
Tracking Status
firefox73 --- fixed

People

(Reporter: jdescottes, Assigned: jdescottes)

References

Details

Attachments

(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 jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/09beec6ec35d Stop listening to tab unload in LocalTabTargetFront r=ochameau https://hg.mozilla.org/integration/autoland/rev/8ab51c4822d4 Remove csp and contentPrincipal getters in LocalTabTargetFront r=ochameau https://hg.mozilla.org/integration/autoland/rev/f8c1648fb4d0 Rename LocalTabTargetFront tab getter to localTab r=ochameau
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: