Adapt ModuleCache::getAllModuleClasses to be compatible with workers
Categories
(Remote Protocol :: WebDriver BiDi, task, P2)
Tracking
(Not tracked)
People
(Reporter: jdescottes, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m14])
In https://bugzilla.mozilla.org/show_bug.cgi?id=1726800 we are adding APIs in ModuleCache in order to discover all modules relevant for a given command from the parent process. This mostly relies on getAllModuleClasses, which returns the Array of classes which implement a given module to reach a certain destination.
For now, we only have 3 MessageHandler types:
- root
- windowglobal-in-root
- windowglobal
Assuming simple layouts such as this, you can build the paths to the module classes by simply combining: the current type, the destination type and the module name.
But this is no longer true for more complex folder layouts, when we introduce workers. To give an example, a command for a "foo" module with a "worker" destination might have module implementations in the following paths:
- worker-in-root/foo.jsm
- worker-in-windowglobal/foo.jsm (or worker-in-contentprocess/foo.jsm, depending on how we implement this)
- worker/foo.jsm
So from the Root MessageHandler, you can't guess the second item just based on the "root" type, the "worker" destination type and the "foo" module name. You also need to know the "layout" of the architecture, and that there is an intermediary layer between root and worker.
We can either describe the layout as a tree and rely on it to implement getAllModuleClasses. Or we can just hardcode it, assuming we should not really support that many layers in the long run.
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Updated•11 months ago
|
Updated•2 months ago
|
Updated•2 months ago
|
Reporter | ||
Updated•1 month ago
|
Description
•