forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1622451 - minimize stream copying across IPC boundaries r=asuth,baku
Initially, IPCInternal{Request,Response} had contained IPCStreams which would result in unecessary copying when sending the objects over IPC. The patch makes these streams either: 1) ParentToParentStream (just a UUID) 2) ParentToChildStream (a PIPCBlobInputStream actor, acting as a handle) 3) ChildToParentStream (a real IPCStream) These three types are union-ed together by the BodyStreamVariant IPDL structure. This structure replaces the IPCStream members in IPCInternal{Request,Response} so that, depending on the particular IPDL protocol, we can avoid cloning streams and just pass handles/IDs instead. As a side effect, this makes file-backed Response objects cloneable. Initially, these Responses would be backed by an nsFileInputStream, which is not cloneable outside the parent process. They are now backed by IPCBlobInputStreams, which are cloneable. One thing that's not really satisfactory (IMO), is the manual management of IPCBlobInputStreamStorage so that no streams are leaked, e.g. if we store a stream in the IPCBlobInputStreamStorage but fail to send an IPC message and therefore fail to remove the stream from storage on the other side of the IPC boundary (only parent-to-parent in this case). Differential Revision: https://phabricator.services.mozilla.com/D73173
- Loading branch information
1 parent
0b1ab06
commit 1ad4e03
Showing
15 changed files
with
391 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.