Open Bug 1564615 Opened 7 years ago Updated 11 days ago

Make GeckoChildProcessHost threadsafe refcounted

Categories

(Core :: IPC, enhancement, P3)

enhancement

Tracking

()

ASSIGNED

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:

  1. 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.
  2. It has subclasses that override the destructor and may also depend on the destruction thread; they will also need to be audited.
  3. It inherits from ::ChildProcessHost in ipc/chromium. We don't use it anywhere else, so it could be merged with GeckoChildProcessHost or modified; it may also have dependencies on the destruction thread.
  4. 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.

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.

Priority: -- → P3
Severity: normal → S3

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.

Assignee: nobody → nika
Status: NEW → ASSIGNED

This keeps the object valid throughout IPC I/O thread shutdown tasks.

Attachment #9626347 - Attachment description: Bug 1564615 - Make GeckoChildProcessHost refcounted, r=#ipc-reviewers! → Bug 1564615 - Part 1: Make GeckoChildProcessHost refcounted, r=#ipc-reviewers!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: