Open Bug 2005009 Opened 10 months ago Updated 6 months ago

Add a RemoteObjectHandle abstraction for referencing an object in another process

Categories

(Core :: IPC, enhancement)

enhancement

Tracking

()

People

(Reporter: nika, Assigned: nika)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

In some cases, it is useful to maintain a reference to a non-transferrable object within a process, such that you can reference it from another process. Doing this manually using a table, and ensuring that the entity is destroyed when the remote process goes away, can be fiddly and requires a good amount of boilerplate.

This patch proposes an abstraction which can be used to handle this situation, using hidden toplevel actors to act as remote reference counts to the underlying types.

I expect that if we get high adoption for this type in the future, we may want to look into further optimizations around the actor overhead for it.

In some cases, it is useful to maintain a reference to a non-transferrable
object within a process, such that you can reference it from another process.
Doing this manually using a table, and ensuring that the entity is destroyed
when the remote process goes away, can be fiddly and requires a good amount of
boilerplate.

This patch proposes an abstraction which can be used to handle this situation,
using hidden toplevel actors to act as remote reference counts to the
underlying types.

I expect that if we get high adoption for this type in the future, we may want
to look into further optimizations around the actor overhead for it.

Attachment #9551488 - Attachment description: WIP: Bug 2005009 - Add RemoteObjectHandle helpers, r=#ipc-reviewers! → Bug 2005009 - Add RemoteObjectHandle helpers, r=#ipc-reviewers!
Attachment #9551488 - Attachment description: Bug 2005009 - Add RemoteObjectHandle helpers, r=#ipc-reviewers! → Bug 2005009 - Part 1: Add RemoteObjectHandle helpers, r=#ipc-reviewers!

This is an extension of the RemoteObjectHandle added in part 1 to support cases
where the target object is not synchronously known when creating the handle.

This can be used within a content process when the actual object only exists in
the parent process, with the Pending object passed to the parent process
immediately to be resolved with the remote object. Then, in the future, the
LazyRemoteObjectHandle can be asynchronously queried to the original object
within the parent process.

This currently is primarily intended for use with future Blob URL changes to
represent a resolved Blob URL entry, but may be useful for other components as
well.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: