Refactor the IPC lifetimes for the PGamepadEventChannel object
Categories
(Core :: DOM: Device Interfaces, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: cmartin, Assigned: cmartin)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
The logic that handles the IPC lifetimes for GamepadEventChannelParent
can be simplified:
The initialization is currently done in a separate RecvGamepadListenerAdded()
message, but that message is always sent directly after actor creation and so they should just be rolled together into the IPC constructor.
Likewise, destruction is handled in both ActorDestroy()
and RecvGamepadListenerRemoved()
, but there's no need for this - ActorDestroy()
should handle all of the cleanup and the RecvGamepadListenerRemoved()
should just be replaced with a Send__delete__()
message in the client.
Doing this simplifies the lifetimes and gets rid of this awkward mHasGamepadListener
variable that just exists to track whether or not the object is in a "zombie state". From now on, if the object exists it is valid.
Also, since we are now being deterministic about creating/deleting our object in a single location, there's no need to reference count it -- Its lifetime is predictable
Assignee | ||
Comment 1•4 years ago
|
||
Change the GamepadEventChannel so it is fully-initialized by the IPC
constuctor and needs no separate "init" message, and so its completely
destroyed by the ActorDestroy() message so it needs no "cleanup" message.
This simplifies the object lifetime, as well as unifies the IPC error vs
clean shutdown paths.
Depends on D83406
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Change the GamepadEventChannel so it is fully-initialized by the IPC
constuctor and needs no separate "init" message, and so its completely
destroyed by the ActorDestroy() message so it needs no "cleanup" message.
This simplifies the object lifetime, as well as unifies the IPC error vs
clean shutdown paths.
Pushed by cmartin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/562a834a3692 Refactor the IPC lifetimes for the PGamepadEventChannel object r=daoshengmu
Comment 4•4 years ago
|
||
Backed outfor build bustages at BackgroundParentImpl
Backout link: https://hg.mozilla.org/integration/autoland/rev/b4d5fb43ba1c2258e069f88700b236ecb6451c89
Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=311692759&repo=autoland&lineNumber=17176
Pushed by cmartin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/82e451b5e01d Refactor the IPC lifetimes for the PGamepadEventChannel object r=daoshengmu
Comment 6•4 years ago
|
||
bugherder |
Assignee | ||
Updated•4 years ago
|
Description
•