gecko-dev/netwerk/cache2
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
..
AppCacheStorage.cpp Bug 1476928 - Remove nsIURI.CloneIgnoringRef and nsIURI.CloneWithNewRef r=JuniorHsu 2018-07-23 11:28:47 +00:00
AppCacheStorage.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
CacheEntry.cpp Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js 2018-10-18 05:51:42 +03:00
CacheEntry.h Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js 2018-10-18 05:51:42 +03:00
CacheFile.cpp Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js 2018-10-18 05:51:42 +03:00
CacheFile.h Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js 2018-10-18 05:51:42 +03:00
CacheFileChunk.cpp Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj 2018-04-28 12:50:58 -07:00
CacheFileChunk.h Bug 1444490 Declare classses (and one method) in network/ final to reduce virtual function calls r=nwgh 2018-03-09 08:37:18 -06:00
CacheFileContextEvictor.cpp Bug 1468501 - Implement a way to delete network cache by nsIPrincipal, r=mayhemer, r=michal 2018-07-20 13:57:18 +02:00
CacheFileContextEvictor.h Bug 1468501 - Implement a way to delete network cache by nsIPrincipal, r=mayhemer, r=michal 2018-07-20 13:57:18 +02:00
CacheFileIOManager.cpp Bug 1484496: Follow-up: Fix more NoQueryNeeded assertions. r=bustage 2018-08-23 17:15:41 -07:00
CacheFileIOManager.h Bug 1468501 - Implement a way to delete network cache by nsIPrincipal, r=mayhemer, r=michal 2018-07-20 13:57:18 +02:00
CacheFileInputStream.cpp Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj 2018-10-18 13:35:35 +02:00
CacheFileInputStream.h Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj 2018-10-18 13:35:35 +02:00
CacheFileMetadata.cpp Bug 1418028 - UBSan: null pointer passed to memcpy in CacheFileMetadata::WriteMetadata. r=honzab 2018-01-18 07:50:00 -05:00
CacheFileMetadata.h Bug 1444490 Declare classses (and one method) in network/ final to reduce virtual function calls r=nwgh 2018-03-09 08:37:18 -06:00
CacheFileOutputStream.cpp Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj 2018-10-18 13:35:35 +02:00
CacheFileOutputStream.h Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj 2018-10-18 13:35:35 +02:00
CacheFileUtils.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
CacheFileUtils.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
CacheHashUtils.cpp
CacheHashUtils.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
CacheIOThread.cpp Backed out 2 changesets (bug 1479035) for assertion failure: mEvents. CLOSED TREE 2018-09-26 23:40:13 +03:00
CacheIOThread.h Bug 1444490 Declare classses (and one method) in network/ final to reduce virtual function calls r=nwgh 2018-03-09 08:37:18 -06:00
CacheIndex.cpp Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
CacheIndex.h Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj 2018-06-17 22:43:11 -07:00
CacheIndexContextIterator.cpp Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
CacheIndexContextIterator.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
CacheIndexIterator.cpp Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj 2018-03-13 14:51:33 +01:00
CacheIndexIterator.h
CacheLog.cpp
CacheLog.h
CacheObserver.cpp Bug 1457084 - Increase max chunk memory usage limit, r=mayhemer 2018-05-23 05:03:00 +03:00
CacheObserver.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
CacheStorage.cpp Bug 1476928 - Remove nsIURI.CloneIgnoringRef and nsIURI.CloneWithNewRef r=JuniorHsu 2018-07-23 11:28:47 +00:00
CacheStorage.h Bug 1457411 - Update netwerk module to make use of newer methods introduced with c++11 and c++14. r=valentin 2018-04-30 19:46:04 +03:00
CacheStorageService.cpp Bug 1468501 - Implement a way to delete network cache by nsIPrincipal, r=mayhemer, r=michal 2018-07-20 13:57:18 +02:00
CacheStorageService.h Bug 1468501 - Implement a way to delete network cache by nsIPrincipal, r=mayhemer, r=michal 2018-07-20 13:57:18 +02:00
OldWrappers.cpp Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js 2018-10-18 05:51:42 +03:00
OldWrappers.h Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js 2018-10-18 05:51:42 +03:00
moz.build Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00
nsICacheEntry.idl Backed out 2 changesets (bug 1487100) for XPCShell failures in netwerk/test/unit_ipc/test_alt-data_simple_wrap.js 2018-10-18 05:51:42 +03:00
nsICacheEntryDoomCallback.idl
nsICacheEntryOpenCallback.idl
nsICacheStorage.idl
nsICacheStorageService.idl Bug 1468501 - Implement a way to delete network cache by nsIPrincipal, r=mayhemer, r=michal 2018-07-20 13:57:18 +02:00
nsICacheStorageVisitor.idl
nsICacheTesting.idl