Simplify DevTools LocalTabTargetFront
Categories
(DevTools :: General, task, P3)
Tracking
(firefox73 fixed)
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 tolocalTab
to make is easier to search (and maybe try to remove a few call sites)
Assignee | ||
Comment 1•5 years ago
|
||
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.
Assignee | ||
Comment 2•5 years ago
|
||
Depends on D56327. Not reason to make target-mixin more complex for this workaround which already has access to the tab object.
Assignee | ||
Comment 3•5 years ago
|
||
Depends on D56330
Renaming the "tab" getter to "localTab" will make it easier to refactor later.
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/09beec6ec35d
https://hg.mozilla.org/mozilla-central/rev/8ab51c4822d4
https://hg.mozilla.org/mozilla-central/rev/f8c1648fb4d0
Description
•