Make GeckoChildProcessHost threadsafe refcounted
Categories
(Core :: IPC, enhancement, P3)
Tracking
()
People
(Reporter: jld, Assigned: nika)
Details
Attachments
(2 files)
GeckoChildProcessHost has a complicated lifetime spread out over multiple threads, managed manually, and it's difficult to work with and dangerously error-prone. We should change it to be thread-safe refcounted.
Known problems that need to be dealt with:
- Currently it expects to be destroyed on the I/O thread; this needs to be investigated to see what depends on that and how that dependency can be broken.
- It has subclasses that override the destructor and may also depend on the destruction thread; they will also need to be audited.
- It inherits from
::ChildProcessHostinipc/chromium. We don't use it anywhere else, so it could be merged withGeckoChildProcessHostor modified; it may also have dependencies on the destruction thread. - It also inherits the callback interface
IPC::Channel::Listener, which is used in a number of other places; this will require investigation to determine how ownership should work.
It may also be useful to make channels refcounted at the same time.
Comment 1•7 years ago
|
||
We can punt on the destruction thread issue by using the _WITH_DESTROY variant of the refcounting macros, and then dispatching the delete call to the right thread in the destroy method.
| Reporter | ||
Updated•7 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 2•29 days ago
|
||
The lifecycle of this type right now is very annoying and complex, and
various child process implementations have had to do different things in
order to deal with the unfortunate lifecycle properties.
Updated•29 days ago
|
| Assignee | ||
Comment 3•11 days ago
|
||
This keeps the object valid throughout IPC I/O thread shutdown tasks.
Updated•11 days ago
|
Description
•