Граф коммитов

9 Коммитов

Автор SHA1 Сообщение Дата
Andrea Marchesini be2551ab2c Bug 1523702 - Max IPC message size for InputStream serialization, r=smaug
The total size of an IPC inputStream message must be less than 1mb. When we
compose the message for the multiplex stream, each sub stream collaborates with
its own size, deciding if it's better to be a pipe stream (IPCRemoteStream) or
a full serialized one.

Differential Revision: https://phabricator.services.mozilla.com/D18543

--HG--
extra : moz-landing-system : lando
2019-02-04 22:50:51 +00:00
Andrea Marchesini 0499bad916 Bug 1520150 - Single InputStreams can serialize themselves as IPCRemoteStreams (pipe) - part 1 - Passing IPC managers around, r=smaug
Before this set of patches, the decision of exposing the stream as a pipe was
centralized in IPCStreamUtils, based on the total expectation size of the IPC
message. This triggers issues when multiplex inputStreams contain something
that cannot be sent as a pipe (IPCBlobInputStream, for instance), or something
that it's better to do not set as a pipe (nsFileInputStream), together with
memory streams (nsStringInputStream), which could make the IPC message greater
then what accepted (1mb).

These patches move the "pipe vs non-pipe" choice into the single inputStream
implementation.
2019-01-28 10:48:35 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Andrea Marchesini 4ebf5b4364 Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj
In the current code there are 3 main issues:

1. nsFileStream is not really thread-safe. There is nothing to protect the
internal members and we see crashes.

2. nsPipeInputStream doesn't implement ::Seek() method and that caused issues
in devtools when a nsHttpChannel sends POST data using a pipe. In order to fix
this, bug 1494176 added a check in nsHttpChannel: if the stream doesn't
implement ::Seek(), let's clone it. This was an hack around nsPipeInputStream,
and it's bad.

3. When nsHttpChannel sends POST data using a file stream, nsFileStream does
I/O on main-thread because of the issue 2. Plus, ::Seek() is called on the
main-thread causing issue 1.

Note that nsPipeInputStream implements only ::Tell(), of the nsISeekableStream
methods. It doesn't implement ::Seek() and it doesn't implement ::SetEOF().

With this patch I want to fix point 2 and point 3 (and consequentially issue 1
- but we need a separate fix for it - follow up). The patch does:

1. it splits nsISeekableStream in 2 interfaces: nsITellableStream and
nsISeekableStream.
2. nsPipeInputStream implements only nsITellableStream.  Doing this, we don't
need the ::Seek() check for point 2 in nsHttpChannel: a simple QI check is
enough.
3. Because we don't call ::Seek() in nsHttpChannel, nsFileStream doesn't do I/O
on the main-thread, and we don't crash doing so.
2018-10-18 13:35:35 +02:00
Andrea Marchesini 4d342e4ebf Bug 1434553 - Implement nsIInputStreamLength and nsIAsyncInputStreamLength - part 8 - PartiallySeekableInputStream exposes nsIInputStreamLength, r=mayhemer 2018-05-23 07:12:35 +02:00
Andrea Marchesini 06a6fb4d1b Bug 1451731 - Synchronize access to various stream classes' async wait callback reference - part 4 - PartiallySeekableInputStream, r=mayhemer 2018-04-10 17:33:09 +02:00
Ben Kelly 909001ec5a Bug 1424754 Fix some corner cases in PartiallySeekableInputStream cloning and serialization. r=baku 2017-12-13 09:56:31 -05:00
Andrea Marchesini 20fa36b7c1 Bug 1405976 - PartiallySeekableInputStream must take the ownership of the underlying stream, r=qdot 2017-10-13 10:07:32 +02:00
Andrea Marchesini 3ccb9d2674 Bug 1397635 - Support for non-seekable stream in HTTP connection, r=bagder 2017-09-08 16:06:26 +02:00