Allow marking an IPC actor as RefCounted
Categories
(Core :: IPC, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
References
(Blocks 1 open bug)
Details
Attachments
(5 files)
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
The syntax for the new construct looks like the following, and re-uses the
refcounted keyword from refcounted using statements:
async refcounted protocol PFoo { ... }
Assignee | ||
Comment 2•6 years ago
|
||
This takes the approach of directly tying the AddRef()
and Release()
calls
on the underlying actor object to the lifecycle of the ActorLifecycleProxy
object, by adding another virtual ActorAlloc()
method as the counterpart to
ActorDealloc()
.
The changes to the methods called from C++ are relatively minimal:
-
The
SendPFooConstructor(...)
methods have the same signature, but now will
AddRef() internally (throughActorAlloc()
), so ando_AddRef(foo).take()
isn't needed. Same with the{Bind,Open}PFooEndpoint
methods.This was done to reduce the number of invasive internal changes in the
codegen which were required to pipe a passed-inalready_AddRefed
to the
underlyingActorLifecycleProxy
which is created by generic code. -
The
AllocPFoo{Parent,Child}
methods have been modified to return an
already_AddRefed
by default, and the callsites will store the result in a
RefPtr<T>
if the type is refcounted. -
No
DeallocPFoo...
method is called anymore. Unfortunately due to
devirtualization, it won't be an error if an unused method is still present,
though it won't be called.
Assignee | ||
Comment 3•6 years ago
|
||
This is an example refcounted actor which was easy enough to port over as an
initial test. More can be ported in the future, potentially alongside removing
mIPCOpen
.
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/1c6fd8c0baeb
https://hg.mozilla.org/mozilla-central/rev/997252eb5071
https://hg.mozilla.org/mozilla-central/rev/dad8b9f72267
https://hg.mozilla.org/mozilla-central/rev/d771fa8b9289
https://hg.mozilla.org/mozilla-central/rev/7977d9421ecd
Assignee | ||
Updated•6 years ago
|
Description
•