On Fri, May 20, 2016 at 2:19 AM, Ben Kelly <bke...@mozilla.com> wrote:

> On Thu, May 19, 2016 at 1:41 PM, Andrew McCreight <amccrei...@mozilla.com>
> wrote:
>
> > On Thu, May 19, 2016 at 8:04 AM, Ben Kelly <bke...@mozilla.com> wrote:
> >
> > > 3) Supports async pipe streams using a new PSendStream actor from
> > > *child-to-parent*.  I have plans to add support for parent-to-child,
> but
> > I
> > > don't have a consumer yet and we need to figure out some issues with
> > > PBackground targeting worker threads.
> > >
> >
> > One place that this would be very useful would be for networking. Right
> > now, the various networking protocols send data to the child by calling
> > NS_ReadInputStreamToString(), then copying the string into an IPC
> message,
> > which is bad because it requires a lot of contiguous memory addresses,
> and
> > also has a fair bit of bloat from all of the copies (bug 1110596, bug
> > 1263028).
> >
>
> That would be a good thing to try.  I wonder how many consumers assume
> nsIChannel::OnDataAvailable() provides a fixed length stream, though.
>

The copying we want to avoid in bug 1110596 is from a stream to a nsCString
buffer, which to let a stream write to the IPC Pickle buffer directly.

But I checked SendStreamChildImpl::DoRead() [1], it still reads to a
nsCString buffer at first. The good thing is it sends the stream's data in
chunks of 32k at maximum, which can avoid the bloat.

[1]
https://dxr.mozilla.org/mozilla-central/rev/c4449eab07d39e20ea315603f1b1863eeed7dcfe/ipc/glue/SendStreamChild.cpp#276-282

Ting


> Here is the bug to track parent-to-child pipe streaming:
>
> https://bugzilla.mozilla.org/show_bug.cgi?id=1274343
>
> Thanks.
>
> Ben
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to