summaryrefslogtreecommitdiffstats
path: root/dom/file
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/file
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/file')
-rw-r--r--dom/file/ipc/tests/script_file.js4
-rw-r--r--dom/file/tests/common_blob.js2
-rw-r--r--dom/file/tests/worker_blob_reading.js2
-rw-r--r--dom/file/tests/worker_fileReader.js2
-rw-r--r--dom/file/uri/BlobURLInputStream.cpp7
-rw-r--r--dom/file/uri/BlobURLProtocolHandler.cpp7
6 files changed, 15 insertions, 9 deletions
diff --git a/dom/file/ipc/tests/script_file.js b/dom/file/ipc/tests/script_file.js
index 03cefeb3f1..331fd4a9c5 100644
--- a/dom/file/ipc/tests/script_file.js
+++ b/dom/file/ipc/tests/script_file.js
@@ -3,7 +3,7 @@
// eslint-disable-next-line mozilla/reject-importGlobalProperties
Cu.importGlobalProperties(["File"]);
-addMessageListener("file.open", function (e) {
+addMessageListener("file.open", function () {
var testFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
@@ -29,7 +29,7 @@ addMessageListener("file.open", function (e) {
});
});
-addMessageListener("emptyfile.open", function (e) {
+addMessageListener("emptyfile.open", function () {
var testFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
diff --git a/dom/file/tests/common_blob.js b/dom/file/tests/common_blob.js
index 261909af0d..39ece679e0 100644
--- a/dom/file/tests/common_blob.js
+++ b/dom/file/tests/common_blob.js
@@ -1,3 +1,5 @@
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
const RANGE_1 = 1;
const RANGE_2 = 2;
diff --git a/dom/file/tests/worker_blob_reading.js b/dom/file/tests/worker_blob_reading.js
index f57161c220..8ad421062f 100644
--- a/dom/file/tests/worker_blob_reading.js
+++ b/dom/file/tests/worker_blob_reading.js
@@ -1,3 +1,5 @@
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
importScripts("common_blob_reading.js");
function info(message) {
diff --git a/dom/file/tests/worker_fileReader.js b/dom/file/tests/worker_fileReader.js
index 2e8408d1bb..fe7c49e64f 100644
--- a/dom/file/tests/worker_fileReader.js
+++ b/dom/file/tests/worker_fileReader.js
@@ -1,3 +1,5 @@
+/* eslint-disable mozilla/no-comparison-or-assignment-inside-ok */
+
importScripts("common_fileReader.js");
function ok(a, msg) {
diff --git a/dom/file/uri/BlobURLInputStream.cpp b/dom/file/uri/BlobURLInputStream.cpp
index 34a1bb63e8..41259baa82 100644
--- a/dom/file/uri/BlobURLInputStream.cpp
+++ b/dom/file/uri/BlobURLInputStream.cpp
@@ -12,6 +12,7 @@
#include "mozilla/ScopeExit.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/IPCBlobUtils.h"
+#include "mozilla/net/ContentRange.h"
#include "nsStreamUtils.h"
#include "nsMimeTypes.h"
@@ -488,9 +489,9 @@ nsresult BlobURLInputStream::StoreBlobImplStream(
// If a Range header was in the request then fetch/XHR will have set a
// ContentRange on the channel earlier so we may slice the blob now.
blobImpl->GetType(blobContentType);
- const Maybe<nsBaseChannel::ContentRange>& contentRange =
- mChannel->GetContentRange();
- if (contentRange.isSome()) {
+ const RefPtr<mozilla::net::ContentRange>& contentRange =
+ mChannel->ContentRange();
+ if (contentRange) {
IgnoredErrorResult result;
uint64_t start = contentRange->Start();
uint64_t end = contentRange->End();
diff --git a/dom/file/uri/BlobURLProtocolHandler.cpp b/dom/file/uri/BlobURLProtocolHandler.cpp
index 3e2d8e788e..978e88cc8b 100644
--- a/dom/file/uri/BlobURLProtocolHandler.cpp
+++ b/dom/file/uri/BlobURLProtocolHandler.cpp
@@ -948,7 +948,7 @@ nsresult NS_GetBlobForBlobURISpec(const nsACString& aSpec,
}
// Blob requests may specify a range header. We parse, validate, and
-// store that info here, and save it on the nsBaseChannel, where it
+// store that info here, and save it on the nsIBaseChannel, where it
// can be accessed by BlobURLInputStream::StoreBlobImplStream.
nsresult NS_SetChannelContentRangeForBlobURI(nsIChannel* aChannel, nsIURI* aURI,
nsACString& aRangeHeader) {
@@ -963,9 +963,8 @@ nsresult NS_SetChannelContentRangeForBlobURI(nsIChannel* aChannel, nsIURI* aURI,
if (result.Failed()) {
return NS_ERROR_NO_CONTENT;
}
- nsBaseChannel* bchan = static_cast<nsBaseChannel*>(aChannel);
- MOZ_ASSERT(bchan);
- if (!bchan->SetContentRange(aRangeHeader, size)) {
+ nsCOMPtr<nsIBaseChannel> baseChan = do_QueryInterface(aChannel);
+ if (!baseChan || !baseChan->SetContentRangeFromHeader(aRangeHeader, size)) {
return NS_ERROR_NET_PARTIAL_TRANSFER;
}
return NS_OK;