gecko-dev/xpcom/io
Nika Layzell aef919f890 Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen
This patch changes how nsConverterInputStream handles passing data
through to the underlying unicode converter in order to make it more
reliably handle propagating errors and deal with short reads from the
underlying input stream.

This was done by making the code continuously read within the Fill
method until at least one character has been decoded from the input
stream, so that we don't spuriously communicate an EOF to the caller due
to a short read not producing enough bytes for the decoder to produce a
UTF-16 character.

In addition, while making this change it became easier to signal to
the decoder about the final read from the input stream, meaning that
partial characters at the end of the stream will now generate a
replacement character, rather than being ignored.

Differential Revision: https://phabricator.services.mozilla.com/D152682
2022-08-11 17:37:20 +00:00
..
Base64.cpp Bug 1755896 - Add support from AString to ACString Base64 decoding. r=hsivonen 2022-02-18 10:42:10 +00:00
Base64.h Bug 1755896 - Add support from AString to ACString Base64 decoding. r=hsivonen 2022-02-18 10:42:10 +00:00
CocoaFileUtils.h
CocoaFileUtils.mm
FileDescriptorFile.cpp Bug 1707462 - expose Windows' localized file display names through XPCOM, r=mhowell 2022-05-23 21:57:02 +00:00
FileDescriptorFile.h
FilePreferences.cpp Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
FilePreferences.h Bug 1762920: remove whitelist from xpcom/crashreporter r=nika,gsvelto 2022-05-16 01:37:39 +00:00
FileUtilsWin.cpp
FileUtilsWin.h
InputStreamLengthHelper.cpp
InputStreamLengthHelper.h
InputStreamLengthWrapper.cpp Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw 2022-05-13 14:16:13 +00:00
InputStreamLengthWrapper.h Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
NonBlockingAsyncInputStream.cpp Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw 2022-05-13 14:16:13 +00:00
NonBlockingAsyncInputStream.h Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
SlicedInputStream.cpp Bug 1754004 - Part 11: Simplify the IPCStream serialization API, r=asuth,necko-reviewers,kershaw 2022-05-13 14:16:13 +00:00
SlicedInputStream.h Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
SnappyCompressOutputStream.cpp Bug 1754040 - Clean up common shared WriteSegments helper functions, r=necko-reviewers,xpcom-reviewers,mccr8 2022-02-14 23:59:35 +00:00
SnappyCompressOutputStream.h
SnappyFrameUtils.cpp
SnappyFrameUtils.h
SnappyUncompressInputStream.cpp
SnappyUncompressInputStream.h
SpecialSystemDirectory.cpp Bug 1766375 - Fix implicit-fallthrough warnings in Windows builds. r=media-playback-reviewers,necko-reviewers,rkraesig,xpcom-reviewers,nika,bryce,kershaw 2022-04-27 22:12:53 +00:00
SpecialSystemDirectory.h Bug 1435766 - Reimplement nsDirectoryService Mac getters in terms of GetSpecialSystemDirectory, r=xpcom-reviewers,mccr8 2022-04-06 20:43:07 +00:00
StreamBufferSource.h Bug 1748719 - Make nsStringInputStream more flexible as to the backing data buffer, r=mccr8 2022-01-07 20:34:52 +00:00
components.conf
crc32c.c
crc32c.h
moz.build Bug 1754004 - Part 8: Remove SeekableStreamWrapper, r=asuth,necko-reviewers,kershaw 2022-05-13 14:16:12 +00:00
nsAnonymousTemporaryFile.cpp
nsAnonymousTemporaryFile.h
nsAppDirectoryServiceDefs.h
nsAppFileLocationProvider.cpp
nsAppFileLocationProvider.h
nsBinaryStream.cpp
nsBinaryStream.h
nsDirectoryService.cpp Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika 2022-05-17 20:24:19 +00:00
nsDirectoryService.h Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika 2022-05-17 20:24:19 +00:00
nsDirectoryServiceDefs.h
nsDirectoryServiceUtils.h
nsEscape.cpp Bug 1746645 - Generate EscapeChars array programmatically. r=xpcom-reviewers,nika 2022-01-19 10:21:05 +00:00
nsEscape.h Bug 1737854 - macOS 'Share' menu modifies URL such that shared page doesn't load r=necko-reviewers,mstange,valentin 2021-11-10 19:32:53 +00:00
nsIAsyncInputStream.idl
nsIAsyncOutputStream.idl
nsIBinaryInputStream.idl
nsIBinaryOutputStream.idl
nsICloneableInputStream.idl
nsIConverterInputStream.idl
nsIConverterOutputStream.idl
nsIDirectoryEnumerator.idl
nsIDirectoryService.idl
nsIFile.idl Bug 1707462 - expose Windows' localized file display names through XPCOM, r=mhowell 2022-05-23 21:57:02 +00:00
nsIIOUtil.idl
nsIInputStream.idl Bug 1754004 - Part 14: Fix potential skipping of async streams in nsMultiplexInputStream, r=asuth 2022-05-13 14:16:14 +00:00
nsIInputStreamLength.idl
nsIInputStreamPriority.idl
nsIInputStreamTee.idl
nsILineInputStream.idl
nsILocalFileMac.idl Bug 1736331 - Add nsILocalFileMac methods for interacting with extended attributes r=nika 2021-12-25 00:30:10 +00:00
nsILocalFileWin.idl Bug 1761438 - Remove nsILocalFileWin::GetNativeCanonicalPath. r=xpcom-reviewers,application-update-reviewers,mccr8,nalexander 2022-03-26 00:52:07 +00:00
nsIMultiplexInputStream.idl Bug 1754004 - Part 7: Consistently normalize upload streams passed to HTTP channels, r=asuth,necko-reviewers,dragana 2022-05-13 14:16:11 +00:00
nsIOUtil.cpp
nsIOUtil.h
nsIObjectInputStream.idl
nsIObjectOutputStream.idl
nsIOutputStream.idl
nsIPipe.idl
nsISafeOutputStream.idl
nsIScriptableBase64Encoder.idl
nsIScriptableInputStream.idl
nsISeekableStream.idl
nsIStorageStream.idl
nsIStreamBufferAccess.idl
nsIStringStream.idl Bug 1748719 - Make nsStringInputStream more flexible as to the backing data buffer, r=mccr8 2022-01-07 20:34:52 +00:00
nsITellableStream.idl
nsIUnicharInputStream.idl Bug 1170668 - Improve short read handling in nsConverterInputStream, r=hsivonen 2022-08-11 17:37:20 +00:00
nsIUnicharLineInputStream.idl
nsIUnicharOutputStream.idl
nsInputStreamTee.cpp
nsLinebreakConverter.cpp Bug 1770107 - Disambiguate char16_t* operator== overloads in MinGW build for C++23. r=xpcom-reviewers,nika 2022-05-20 06:06:19 +00:00
nsLinebreakConverter.h
nsLocalFile.h Bug 1519200 - Remove `NS_ERROR_FILE_TARGET_DOES_NOT_EXIST` in favor of `NS_ERROR_FILE_NOT_FOUND`. r=xpcom-reviewers,nika,dom-storage-reviewers,jstutte 2022-04-05 15:17:03 +00:00
nsLocalFileCommon.cpp Bug 1731779 - r=dveditz,mtigley 2021-10-19 22:27:31 +00:00
nsLocalFileCommon.h Bug 1731779 - r=dveditz,mtigley 2021-10-19 22:27:31 +00:00
nsLocalFileUnix.cpp Bug 1774864 - Cleanup xpcom/ includes r=sylvestre 2022-06-24 07:13:59 +00:00
nsLocalFileUnix.h Bug 1774864 - Cleanup xpcom/ includes r=sylvestre 2022-06-24 07:13:59 +00:00
nsLocalFileWin.cpp Bug 1772006 - Part 5: Simplify and move the string searching APIs from ns[T]StringObsolete, r=xpcom-reviewers,necko-reviewers,eeejay,dragana,barret 2022-07-30 00:12:48 +00:00
nsLocalFileWin.h Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika 2022-05-17 20:24:19 +00:00
nsMultiplexInputStream.cpp Bug 1782181 - Part 2: Notify nsMultiplexInputStream callbacks if AsyncWait fails, r=asuth 2022-08-03 19:36:29 +00:00
nsMultiplexInputStream.h Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika 2022-05-17 20:24:19 +00:00
nsNativeCharsetUtils.cpp
nsNativeCharsetUtils.h
nsPipe.h Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika 2022-05-17 20:24:19 +00:00
nsPipe3.cpp Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
nsScriptableBase64Encoder.cpp
nsScriptableBase64Encoder.h
nsScriptableInputStream.cpp Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika 2022-05-17 20:24:19 +00:00
nsScriptableInputStream.h Bug 1514936, part 2 - Drop the outer arguments from static components. r=xpcom-reviewers,nika 2022-05-17 20:24:19 +00:00
nsSegmentedBuffer.cpp
nsSegmentedBuffer.h
nsStorageStream.cpp Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
nsStorageStream.h Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
nsStreamUtils.cpp Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
nsStreamUtils.h Bug 1754040 - Clean up common shared WriteSegments helper functions, r=necko-reviewers,xpcom-reviewers,mccr8 2022-02-14 23:59:35 +00:00
nsStringStream.cpp Bug 1761040 - Prefix thread safety macros with MOZ_ r=geckoview-reviewers,media-playback-reviewers,alwu,jesup,m_kato 2022-08-03 16:39:41 +00:00
nsStringStream.h Bug 1748719 - Make nsStringInputStream more flexible as to the backing data buffer, r=mccr8 2022-01-07 20:34:52 +00:00
nsUnicharInputStream.cpp Bug 1741665 - Align nsCString's public size_type better with other C++ APIs, r=mccr8,geckoview-reviewers,agi 2021-12-13 21:47:56 +00:00
nsUnicharInputStream.h
nsWildCard.cpp
nsWildCard.h