Closed Bug 1656888 Opened 4 years ago Closed 4 years ago

Preliminary work for worker support in TargetList/Resource API

Categories

(DevTools :: Framework, task)

task

Tracking

(Fission Milestone:M6c, firefox81 fixed)

RESOLVED FIXED
81 Branch
Fission Milestone M6c
Tracking Status
firefox81 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

(Whiteboard: dt-fission-m2-mvp)

Attachments

(4 files)

This bug will contain all the parts that can be done beforedoing the core work of Bug 1633712 (making the tests better, making some object ready for the resource API, …)

Whiteboard: dt-fission-m2-mvp

Tracking dt-fission-m2-mvp bugs for Fission Nightly milestone (M6c).

Fission Milestone: --- → M6c

fission_document.html's iframe was on example.com while the top document
is always on example.com as well, so we weren't exercising fission in it.
This patch puts the iframe on example.org, which highlighted some TargetList
test failures that this patch addresses.

Numerous test cases are added to check behaviour of the targetList when workers:

  • already exists
  • are spawned
  • are terminated
    in same document or remote iframe.

The test is tagged as fail-if when fission is enabled since we don't get the
workers for remote iframes.

Since the iframe now has a service worker (on example.org), we need to unregister
it in browser_target_list_service_workers_navigation as it's not the expected
service worker.

Depends on D85812

The watchResources function [1] takes as a first parameter either a watcher
actor or a target actor, that is used to manage the created resources (e.g. the
object actors of console messages). In order to be able to manage actors, it
needs to extend the Pool class (which is the case for actors).
In the worker cases, things are a bit different, since we create a DevToolServer
which only have a WebConsole and a Thread actor. Those actors usually take a target
actor as a parent, but in the Worker thread we simply have an object implementing
the properties and methods it needs.
This will be this "parent" that we're going to pass to watchResources, and in
order to be able to do that, it needs to be able to manage actors.

In regard of all this, this patch makes the "parent" a Pool, on which we then
put the existing methods and properties.
We take this opportunity to store the parent in the connections object we have,
in order to be able to retrieve it later (e.g. when the WorkerTargetActor on
the content process main thread will notify the Worker thread about resources
to watch/unwatch).

[1] https://searchfox.org/mozilla-central/rev/0e309417bdc73be33fc93f6bd7a0d4063d2c6e51/devtools/server/actors/resources/index.js#66

Depends on D85813

Depends on D85814

Attachment #9167805 - Attachment description: Bug 1656888 - Make WorkerThread's mock parent a Pool so it's resource API ready. r=ochameau. → Bug 1656888 - Make WorkerThread's mock parent an Actor. r=ochameau.
Attachment #9167804 - Attachment description: Bug 1656888 - Add test cases to browser_target_list_workers. r=jdescottes. → Bug 1656888 - Add test cases for TargetList worker support. r=jdescottes.
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/004fe587a64f
Make the iframe in fission_document.html a remote iframe. r=jdescottes.
https://hg.mozilla.org/integration/autoland/rev/100544e67bff
Add test cases for TargetList worker support. r=jdescottes.
https://hg.mozilla.org/integration/autoland/rev/e94bc39e9ab7
Make WorkerThread's mock parent an Actor. r=ochameau.
https://hg.mozilla.org/integration/autoland/rev/89cad404dde9
Load ad-hoc console listener module in worker context. r=ochameau.
Regressions: 1657378
Blocks: 1657386
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: