Closed Bug 1770130 Opened 2 years ago Closed 2 years ago

Remove unecessary worker descriptor/target attach methods

Categories

(DevTools :: Framework, enhancement)

enhancement

Tracking

(firefox102 fixed)

RESOLVED FIXED
102 Branch
Tracking Status
firefox102 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

These two attach method are a relic of the past:
WorkerDescriptorActor.attach isn't really necessary and could be done right away from the actor's constructor:
https://searchfox.org/mozilla-central/rev/7f729f601c0b738f870ae0ed49098f9268e250f9/devtools/server/actors/descriptors/worker.js#88

While WorkerTargetFront.attach is still justified until we support server side worker targets for all the toolboxes:
https://searchfox.org/mozilla-central/rev/7f729f601c0b738f870ae0ed49098f9268e250f9/devtools/client/fronts/descriptors/worker.js#66
But in the meantime we might rename it to make it clear this is an hopefully temporary workaround.

As for other targets, we can instantiate the ThreadActor right away when creating the target.
There is no need to do that later, only on-demand.

Note that it doesn't mean the thread actor itself will be attached.

Assignee: nobody → poirot.alex
Status: NEW → ASSIGNED

We can immediately "attach" the descriptor as it gets instantiated.
So that the frontend no longer need to call this before doing anything around the worker.

I also renamed the descriptor front method "attach" method,
in order to better highlight how special it is.
Hopefully we can drop this once the worker targets are created by the server.
i.e. when we enable service side worker targets for the browser toolbox,
which includes supporting service workers.

Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eb6a4ba9790d
[devtools] Get rid of WorkerTargetActor.attach. r=nchevobbe
https://hg.mozilla.org/integration/autoland/rev/7c45dfdb5932
[devtools] Get rid of WorkerDescriptorActor.attach. r=nchevobbe,devtools-backward-compat-reviewers
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: