Closed Bug 1735825 Opened 3 years ago Closed 3 years ago

Introduce a context object alongside Watcher Actor universe

Categories

(DevTools :: Framework, task)

task

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-perf-stability-mvp)

Attachments

(3 files)

In order to introduce a third type of context for the WatcherActor, it would be benefitial to introduce a object passed around everywhere around the WatcherActor that would help described what we should debug/expose.

A "context" object store on the Watcher Actor, with a type attribute that could be:

  • "all" for the browser toolbox, which should debug everything
  • "browser-element" for tab debugging, which should debug only one given browser-element
    And in a near future:
  • "web-extension" for add-on debugging, and somehow debugging the right browser-element's related to the add-on.
  • "service-worker" for debugging workers from about:debugging
    Alongside this type attribute, we may have as many useful attribute specific to each context type.
    type: "all" would most likely not require anything else,
    but type: "browser-element" would benefit from a browserId attribute to identify the one <browser> element we want to target.

Also, this context object will be transfered to content processes and worker threads, so we should keep in mind to keep it serializable.

This is only the beginning, focusing first on parent process usages.
WatcherActor still expose browserElement shortcut as it is useful in many places.
Context is kept JSON-serializable in order to later pass it through the SessionData.

This is the second and last step, to propagate the context down to the content process.
So that now, whenever we introduce a new context or add something into it,
it should be automatically made available to the whole codebase.

Attachment #9245947 - Attachment description: Bug 1735825 - [devtools] Pass Watcher's context down to the content process via DevToolsFrame queries and WatcheRegistry. → Bug 1735825 - [devtools] Pass Watcher's context down to the content process via DevToolsFrame queries and WatcherRegistry.
Attachment #9245947 - Attachment description: Bug 1735825 - [devtools] Pass Watcher's context down to the content process via DevToolsFrame queries and WatcherRegistry. → Bug 1735825 - [devtools] Pass Watcher's context down to the content process via DevToolsFrame queries and WatcheRegistry.
Blocks: 1737100
Blocks: 1737102
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4e2ba86016fe [devtools] Introduce a context in Watcher actor to describe what context should be debugged. r=jdescottes https://hg.mozilla.org/integration/autoland/rev/ef25f892cec3 [devtools] Pass Watcher's context down to the content process via DevToolsFrame queries and WatcheRegistry. r=jdescottes https://hg.mozilla.org/integration/autoland/rev/6e1fab3e66c8 [devtools] Pass watcher context down to TargetActorRegistry. r=jdescottes

Backed out 3 changesets (Bug 1735825) for causing bc failures on browser_ext_devtools_inspectedWindow.js.
Backout link
Push with failures
Failure Log

Flags: needinfo?(poirot.alex)
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2e494aaf92a8 [devtools] Introduce a context in Watcher actor to describe what context should be debugged. r=jdescottes https://hg.mozilla.org/integration/autoland/rev/e155545942a8 [devtools] Pass Watcher's context down to the content process via DevToolsFrame queries and WatcheRegistry. r=jdescottes https://hg.mozilla.org/integration/autoland/rev/87a72f8dd901 [devtools] Pass watcher context down to TargetActorRegistry. r=jdescottes,rpl
Flags: needinfo?(poirot.alex)
Blocks: 1699676
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: