Add polymorphic type support to protocol.js
Categories
(DevTools :: Framework, enhancement)
Tracking
(firefox74 fixed)
Tracking | Status | |
---|---|---|
firefox74 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(3 files)
For now, you can only return a unique type of actor from an actor method, or pass a unique type of front to a front method argument.
But in many case, we do return more than one possible type of actor.
For example, the target actors could be a BrowsingContextTargetActor inherited actor, or a ContentProcessTargetActor.
In order to support that, we have to avoid using protocol.js types and use json
as a type. Then we need to manually convert the actor to its form, via actor.form()
on the actor side. And on the client side, we have to manually instantiate the front from the form.
It would be nice to add some support for polymorphism, so that we can return more than just one type of actor and have protocol.js to automatically pass the form on the wire, and instantiate the right Front class on the client side.
Assignee | ||
Comment 1•5 years ago
|
||
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
Comment 5•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/92d116a3c59d
https://hg.mozilla.org/mozilla-central/rev/1e72656e038e
https://hg.mozilla.org/mozilla-central/rev/373c0e15c266
Description
•