summaryrefslogtreecommitdiffstats
path: root/netwerk/ipc/NeckoCommon.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:11:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:11:27 +0000
commitf3bcaf9f88aad2c423ebcd61121562f9834187d4 (patch)
treef22238c29b57707b645a350940e3e9bdf3ce1f5d /netwerk/ipc/NeckoCommon.cpp
parentAdding debian version 115.7.0esr-1~deb12u1. (diff)
downloadfirefox-esr-f3bcaf9f88aad2c423ebcd61121562f9834187d4.tar.xz
firefox-esr-f3bcaf9f88aad2c423ebcd61121562f9834187d4.zip
Merging upstream version 115.8.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netwerk/ipc/NeckoCommon.cpp')
-rw-r--r--netwerk/ipc/NeckoCommon.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/netwerk/ipc/NeckoCommon.cpp b/netwerk/ipc/NeckoCommon.cpp
index c08faa5747..9ad4483d32 100644
--- a/netwerk/ipc/NeckoCommon.cpp
+++ b/netwerk/ipc/NeckoCommon.cpp
@@ -14,28 +14,26 @@
namespace mozilla::net {
-nsresult ForwardStreamListenerFunctions(
- nsTArray<StreamListenerFunction>& aCalls, nsIStreamListener* aParent) {
+nsresult ForwardStreamListenerFunctions(nsTArray<StreamListenerFunction> aCalls,
+ nsIStreamListener* aParent) {
nsresult rv = NS_OK;
for (auto& variant : aCalls) {
variant.match(
- [&](const OnStartRequestParams& aParams) {
+ [&](OnStartRequestParams& aParams) {
rv = aParent->OnStartRequest(aParams.request);
if (NS_FAILED(rv)) {
aParams.request->Cancel(rv);
}
},
- [&](const OnDataAvailableParams& aParams) {
+ [&](OnDataAvailableParams& aParams) {
// Don't deliver OnDataAvailable if we've
// already failed.
if (NS_FAILED(rv)) {
return;
}
nsCOMPtr<nsIInputStream> stringStream;
- rv = NS_NewByteInputStream(
- getter_AddRefs(stringStream),
- Span<const char>(aParams.data.get(), aParams.count),
- NS_ASSIGNMENT_DEPEND);
+ rv = NS_NewCStringInputStream(getter_AddRefs(stringStream),
+ std::move(aParams.data));
if (NS_SUCCEEDED(rv)) {
rv = aParent->OnDataAvailable(aParams.request, stringStream,
aParams.offset, aParams.count);
@@ -44,7 +42,7 @@ nsresult ForwardStreamListenerFunctions(
aParams.request->Cancel(rv);
}
},
- [&](const OnStopRequestParams& aParams) {
+ [&](OnStopRequestParams& aParams) {
if (NS_SUCCEEDED(rv)) {
aParent->OnStopRequest(aParams.request, aParams.status);
} else {
@@ -52,7 +50,7 @@ nsresult ForwardStreamListenerFunctions(
}
rv = NS_OK;
},
- [&](const OnAfterLastPartParams& aParams) {
+ [&](OnAfterLastPartParams& aParams) {
nsCOMPtr<nsIMultiPartChannelListener> multiListener =
do_QueryInterface(aParent);
if (multiListener) {