gecko-dev/xpcom
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
..
base Bug 1439450 - Ignore has_first_value() check in ProtocolParser. r=francois 2018-10-16 10:36:01 +00:00
build Bug 1498651 - make initial timer target setting more efficient; r=erahm 2018-10-17 19:57:36 -04:00
components Bug 1498586 - Add clang-format off to avoid the reformatting of the data structures r=Ehsan 2018-10-12 20:48:24 +00:00
doc
ds Bug 1494745 part 6 - Make ns[Auto]TObserverArray methods that insert/append an Item return void since they're infallible. r=bz 2018-10-14 18:12:23 +02:00
glue Bug 1489944 - Fixed some std::move warnings - r=froydnj 2018-09-10 15:51:48 +00:00
idl-parser Bug 1496622 - convert Rust nsresult type alias to newtype w/#[repr(transparent)] r=froydnj 2018-10-09 16:02:32 +00:00
io Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj 2018-10-18 13:35:35 +02:00
libxpt/xptcall Bug 1403959, part 2 - Automatically generated eslint fixes. r=froydnj 2017-09-28 15:49:04 -07:00
reflect Bug 1498938 - Support [implicit_jscontext] XPIDL calls on Linux/PPC64.; r=froydnj 2018-10-17 23:12:51 +00:00
rust Bug 1498586 - Add clang-format off to avoid the reformatting of the data structures r=Ehsan 2018-10-12 20:48:24 +00:00
string Bug 1484938 - Make XPCOM string appends and copying assignments write the terminator after writing content. r=froydnj 2018-09-24 14:23:35 +00:00
system Bug 1489047 - Change almost all DOMString occurrences in XPIDL files to AString. r=nika 2018-09-06 18:02:43 +10:00
tests Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj 2018-10-18 13:35:35 +02:00
threads Bug 1498651 - make initial timer target setting more efficient; r=erahm 2018-10-17 19:57:36 -04:00
windbgdlg Bug 1090497 - Re-enable warnings as errors on clang-cl. r=froydnj 2018-07-31 22:10:07 +09:00
xpidl Bug 1459721 - part 7 - remove dist_idl install manifest; r=chmanchester 2018-05-15 10:05:23 -04:00
moz.build Bug 1489340 - Remove xpcom/typelib r=froydnj 2018-09-07 13:55:38 +00:00
xpcom-config.h.in
xpcom-private.h.in Bug 1423846 - Remove configure script checks for iconv and mbrtowc/tcrtomb. r=glandium 2017-12-07 14:06:53 +02:00