Closed Bug 613442 Opened 14 years ago Closed 13 years ago

IPDL: Offer a PFoo::Open(actor) interface to open a new IPC channel between the current process and |actor|'s remote process

Categories

(Core :: IPC, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla7

People

(Reporter: cjones, Assigned: cjones)

References

Details

Attachments

(6 files, 2 obsolete files)

|opens| is much simpler than |bridge|.  The syntax is

 protocol POpener {
   (parent|child) opens POpened;
 };

which says that either POpenerParent or POpenerChild may create a new POpened tree.  POpenedChild will be created by POpenerChild, and POpenedParent will be created by POpenerParent.

The current use for this is opening PVideo/Audio/Media/??? protocol(s) between the content process and chrome process.  Future uses might be
 - opening an rpc-privileged PBackwardsCompat to enable cpows for desktop extensions
 - opening a privileged debugging protocol
 - off-main-content-thread gfx processing

The backend impl of this will be almost the same as for |bridge|.
Produces the graph

Processes
   |jetpackContentChild|
   |jetpackContentParent|
   |contentChild|mediaChild|pluginParent|
     (contentChild)--spawns-->(pluginChild)
   |jetpackChild|
   |contentParent|jetpackParent|compositorChild|mediaParent|
     (contentParent)--spawns-->(compositorParent)
     (contentParent)--spawns-->(jetpackChild)
Bridges
   (jetpackChild)--jetpackContent bridge-->(contentChild)
Opens
   (contentChild)--opens-->(media)

Holding off on review until the backend, which should be pretty straightforward now!
Attachment #491780 - Attachment is obsolete: true
Attachment #492894 - Flags: review?(bent.mozilla)
Probably worth taking a glance at the C++ test (part 6) to see how all these pieces fit together.

The main difference between |bridges| and |opens| is that |bridges| creates a new channel between spanning the "other sides" of actors A and B, that is, it spans two remote processes.  |opens| on the other hand creates a new channel between an actor A and its remote side.  So whereas with |bridges| we're sending channel-opened messages to A-remote and B-remote from A's process, with |opens| we're sending channel-opened messages to A and A-remote.  (Please let me know if this makes sense.)

With that in mind, the map of the implementation should be pretty straightforward --- parts 1, 4, and 5 repurpose machinery created for |bridges| to also work for |opens|.  Part 3 adds support for saying, |asyncChannel->Echo(msg)|, and having the message delivered back to |asyncChannel| in "normal" order.  This means that we can use almost the same code for sending the channel-opened messages for new |bridges| as for new |opens|; the only difference is that with |bridges|, we Send() both notifications, and with |opens| we Send() one and Echo() the other.
This is what we need to allow video decoder threads to communicate directly with the compositor process, right?
It's what we need when the compositor is the chrome process, yeah.  Bug 564086 is what we need when we have a separate compositor process, as was originally planned.
Needed a bit of reorg after requested changes in bug 564086.
Attachment #492897 - Attachment is obsolete: true
Attachment #528810 - Flags: review?(bent.mozilla)
Attachment #492897 - Flags: review?(bent.mozilla)
Attachment #492894 - Flags: review?(bent.mozilla) → review+
Attachment #492896 - Flags: review?(bent.mozilla) → review+
Attachment #492898 - Flags: review?(bent.mozilla) → review+
Comment on attachment 528810 [details] [diff] [review]
part 4: Library support of |opens| API, v2

Looks great! Sorry for the delay :-/
Attachment #528810 - Flags: review?(bent.mozilla) → review+
Target Milestone: --- → mozilla7
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: