gecko-dev/dom/file
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
..
ipc Bug 1486900 - IPCBlobInputStreamChild should be able to shutdown before receiving the remote stream, r=smaug 2018-08-29 11:10:57 +02:00
tests Bug 1480354 - Better approach for nested blobs construction, r=smaug 2018-08-03 08:58:32 +02:00
uri Bug 1489454 - Remove all trailing whitespaces (again) r=Ehsan 2018-09-07 14:47:51 +00:00
BaseBlobImpl.cpp Bug 1440195 For timestamps that are absolute, specify a null context pointer r=baku 2018-02-28 15:37:26 -06:00
BaseBlobImpl.h Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
Blob.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
Blob.h Bug 1446509 - added final versions of macro for declaring AddRef and Decref; r=froydnj 2018-08-07 18:25:49 +00:00
BlobImpl.cpp
BlobImpl.h Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
BlobSet.cpp Bug 1480354 - Better approach for nested blobs construction, r=smaug 2018-08-03 08:58:32 +02:00
BlobSet.h Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
EmptyBlobImpl.cpp Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8 2018-02-12 15:44:40 -05:00
EmptyBlobImpl.h Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8 2018-02-12 15:44:40 -05:00
File.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
File.h Bug 1458883 - Remove File.lastModifiedDate, r=qdot 2018-05-04 14:39:53 +02:00
FileBlobImpl.cpp Bug 1471189 - Removing 'Terminating' state in workers, r=mrbkap 2018-07-12 19:33:41 +02:00
FileBlobImpl.h Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8 2018-02-12 15:44:40 -05:00
FileCreatorHelper.cpp
FileCreatorHelper.h
FileList.cpp Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot 2018-06-26 17:05:01 -07:00
FileList.h Bug 1446515 - Remove nsIDOMFileList. r=bz 2018-03-16 20:55:32 +01:00
FileReader.cpp Bug 1499849 - make FileReader timers slightly more efficient; r=baku 2018-10-17 19:57:35 -04:00
FileReader.h Bug 1452253 - FileReader should use js_free for js_pod_malloc allocations, r=smaug 2018-09-18 16:57:04 +02:00
FileReaderSync.cpp Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug 2018-10-01 21:38:01 +00:00
FileReaderSync.h Bug 1432963 - Fixing workers headers - part 17 - no LIBS=[workers] in moz.build files, r=smaug 2018-01-31 08:25:30 +01:00
MemoryBlobImpl.cpp Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8 2018-02-12 15:44:40 -05:00
MemoryBlobImpl.h Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj 2018-10-18 13:35:35 +02:00
MultipartBlobImpl.cpp Bug 1469126 - Multipart Blobs should use nsMultiplexInputStream only when needed, r=smaug 2018-06-18 11:35:46 -04:00
MultipartBlobImpl.h Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
MutableBlobStorage.cpp Bug 1466023 - nsHostObjectURI renamed BlobURL, r=qdot 2018-06-02 15:51:42 +02:00
MutableBlobStorage.h Bug 1466023 - Separate FontTableURI and BlobURL, r=qdot 2018-06-02 15:51:42 +02:00
MutableBlobStreamListener.cpp Bug 1466023 - Separate FontTableURI and BlobURL, r=qdot 2018-06-02 15:51:42 +02:00
MutableBlobStreamListener.h Bug 1437640 - Implement nsIThreadRetargetableStreamListener in MutableBlobStreamListener, r=smaug 2018-02-14 13:23:01 +01:00
StreamBlobImpl.cpp Bug 1466314 - StreamBlobImpl should wrap the cloned stream with InputStreamLengthWrapper if needed, r=smaug 2018-06-13 08:37:26 -07:00
StreamBlobImpl.h Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
StringBlobImpl.cpp Bug 1413112 - Move FileReaderSync into dom/file, r=me 2018-01-30 10:13:29 +01:00
StringBlobImpl.h Bug 1469126 - GetAllocationSize should report unique blobs when dealing with nested blobs, r=smaug 2018-06-18 11:35:46 -04:00
TemporaryFileBlobImpl.cpp Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj 2018-06-01 10:45:27 +02:00
TemporaryFileBlobImpl.h Bug 1403706 - Remove race conditions in temporary blob - part 5 - Introducing TemporaryFileBlobImpl, r=smaug 2017-10-05 07:41:42 +02:00
moz.build Bug 1466023 - Move blobURL and fontTableURI code in a separate directory, r=qdot 2018-06-02 15:51:42 +02:00