summaryrefslogtreecommitdiffstats
path: root/netwerk/streamconv/converters/nsHTTPCompressConv.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:34:42 +0000
commitda4c7e7ed675c3bf405668739c3012d140856109 (patch)
treecdd868dba063fecba609a1d819de271f0d51b23e /netwerk/streamconv/converters/nsHTTPCompressConv.h
parentAdding upstream version 125.0.3. (diff)
downloadfirefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz
firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/streamconv/converters/nsHTTPCompressConv.h')
-rw-r--r--netwerk/streamconv/converters/nsHTTPCompressConv.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/netwerk/streamconv/converters/nsHTTPCompressConv.h b/netwerk/streamconv/converters/nsHTTPCompressConv.h
index 4ba2d9819c..1008edcf27 100644
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.h
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.h
@@ -34,11 +34,14 @@ class nsIStringInputStream;
# define HTTP_BROTLI_TYPE "br"
# define HTTP_IDENTITY_TYPE "identity"
# define HTTP_UNCOMPRESSED_TYPE "uncompressed"
+# define HTTP_ZSTD_TYPE "zstd"
+# define HTTP_ZST_TYPE "zst"
namespace mozilla {
namespace net {
class BrotliWrapper;
+class ZstdWrapper;
class nsHTTPCompressConv : public nsIStreamConverter,
public nsICompressConvStats {
@@ -60,7 +63,8 @@ class nsHTTPCompressConv : public nsIStreamConverter,
HTTP_COMPRESS_DEFLATE,
HTTP_COMPRESS_COMPRESS,
HTTP_COMPRESS_BROTLI,
- HTTP_COMPRESS_IDENTITY
+ HTTP_COMPRESS_IDENTITY,
+ HTTP_COMPRESS_ZSTD,
};
private:
@@ -77,6 +81,7 @@ class nsHTTPCompressConv : public nsIStreamConverter,
uint32_t mInpBufferLen{0};
UniquePtr<BrotliWrapper> mBrotli;
+ UniquePtr<ZstdWrapper> mZstd;
nsCOMPtr<nsIStringInputStream> mStream;
@@ -84,6 +89,10 @@ class nsHTTPCompressConv : public nsIStreamConverter,
const char* dataIn, uint32_t, uint32_t avail,
uint32_t* countRead);
+ static nsresult ZstdHandler(nsIInputStream* stream, void* closure,
+ const char* dataIn, uint32_t, uint32_t avail,
+ uint32_t* countRead);
+
nsresult do_OnDataAvailable(nsIRequest* request, uint64_t aSourceOffset,
const char* buffer, uint32_t aCount);
@@ -92,6 +101,7 @@ class nsHTTPCompressConv : public nsIStreamConverter,
bool mStreamInitialized{false};
bool mDummyStreamInitialised{false};
bool mFailUncleanStops;
+ bool mDispatchToMainThread{false};
z_stream d_stream{};
unsigned mLen{0}, hMode{0}, mSkipCount{0}, mFlags{0};