summaryrefslogtreecommitdiffstats
path: root/dom/file
diff options
context:
space:
mode:
Diffstat (limited to '')
-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
-rw-r--r--dom/filesystem/compat/tests/script_entries.js4
-rw-r--r--dom/filesystem/compat/tests/test_basic.html18
-rw-r--r--dom/filesystem/tests/script_fileList.js4
-rw-r--r--dom/filesystem/tests/script_promptHandler.js6
-rw-r--r--dom/filesystem/tests/test_basic.html2
-rw-r--r--dom/filesystem/tests/test_webkitdirectory.html10
12 files changed, 37 insertions, 31 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;
diff --git a/dom/filesystem/compat/tests/script_entries.js b/dom/filesystem/compat/tests/script_entries.js
index 7f52fe6bf2..74f3ee18bc 100644
--- a/dom/filesystem/compat/tests/script_entries.js
+++ b/dom/filesystem/compat/tests/script_entries.js
@@ -3,7 +3,7 @@
Cu.importGlobalProperties(["File", "Directory"]);
var tmpFile, tmpDir;
-addMessageListener("entries.open", function (e) {
+addMessageListener("entries.open", function () {
tmpFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("TmpD", Ci.nsIFile);
@@ -40,7 +40,7 @@ addMessageListener("entries.open", function (e) {
});
});
-addMessageListener("entries.delete", function (e) {
+addMessageListener("entries.delete", function () {
tmpFile.remove(true);
tmpDir.remove(true);
sendAsyncMessage("entries.deleted");
diff --git a/dom/filesystem/compat/tests/test_basic.html b/dom/filesystem/compat/tests/test_basic.html
index 4ad0c37d67..552827eb4f 100644
--- a/dom/filesystem/compat/tests/test_basic.html
+++ b/dom/filesystem/compat/tests/test_basic.html
@@ -168,7 +168,7 @@ function test_directoryEntry_getFile_simple() {
function(e) {
is(e.name, "foo.txt", "We have the right FileEntry.");
test_getParent(e, directoryEntry, /* nested */ false);
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -178,7 +178,7 @@ function test_directoryEntry_getFile_deep() {
function(e) {
is(e.name, "bar..txt", "We have the right FileEntry.");
test_getParent(e, directoryEntry, /* nested */ true);
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -228,7 +228,7 @@ function test_directoryEntry_getDirectory_simple() {
function(e) {
is(e.name, "subdir", "We have the right DirectoryEntry.");
test_getParent(e, directoryEntry, /* nested */ false);
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -238,7 +238,7 @@ function test_directoryEntry_getDirectory_deep() {
function(e) {
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
test_getParent(e, directoryEntry, /* nested */ true);
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -308,7 +308,7 @@ function test_root_getFile_simple() {
function(e) {
is(e.name, fileEntry.name, "We have the right FileEntry.");
next();
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -318,7 +318,7 @@ function test_root_getFile_deep() {
function(e) {
is(e.name, "bar..txt", "We have the right FileEntry.");
next();
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -368,7 +368,7 @@ function test_root_getDirectory_simple() {
function(e) {
is(e.name, directoryEntry.name, "We have the right DirectoryEntry.");
next();
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -378,7 +378,7 @@ function test_root_getDirectory_deep() {
function(e) {
is(e.name, "subsubdir", "We have the right DirectoryEntry.");
next();
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
@@ -402,7 +402,7 @@ function test_getParent(entry, parentEntry, nested) {
} else {
test_getParent(e, parentEntry, false);
}
- }, function(e) {
+ }, function() {
ok(false, "This should not happen.");
});
}
diff --git a/dom/filesystem/tests/script_fileList.js b/dom/filesystem/tests/script_fileList.js
index 47438aa7b3..2730a96261 100644
--- a/dom/filesystem/tests/script_fileList.js
+++ b/dom/filesystem/tests/script_fileList.js
@@ -153,7 +153,7 @@ addMessageListener("dir.open", function (e) {
});
});
-addMessageListener("file.open", function (e) {
+addMessageListener("file.open", function () {
var testFile = Services.dirsvc
.QueryInterface(Ci.nsIProperties)
.get("ProfD", Ci.nsIFile);
@@ -164,7 +164,7 @@ addMessageListener("file.open", function (e) {
});
});
-addMessageListener("symlink.open", function (e) {
+addMessageListener("symlink.open", function () {
let testDir = createTestFile();
let testFile = testDir.clone();
testFile.append("subdir");
diff --git a/dom/filesystem/tests/script_promptHandler.js b/dom/filesystem/tests/script_promptHandler.js
index ed3bda7404..235842b455 100644
--- a/dom/filesystem/tests/script_promptHandler.js
+++ b/dom/filesystem/tests/script_promptHandler.js
@@ -2,17 +2,17 @@
let dialogObserverTopic = "common-dialog-loaded";
-function dialogObserver(subj, topic, data) {
+function dialogObserver(subj) {
subj.document.querySelector("dialog").acceptDialog();
sendAsyncMessage("promptAccepted");
}
-addMessageListener("init", message => {
+addMessageListener("init", () => {
Services.obs.addObserver(dialogObserver, dialogObserverTopic);
sendAsyncMessage("initDone");
});
-addMessageListener("cleanup", message => {
+addMessageListener("cleanup", () => {
Services.obs.removeObserver(dialogObserver, dialogObserverTopic);
sendAsyncMessage("cleanupDone");
});
diff --git a/dom/filesystem/tests/test_basic.html b/dom/filesystem/tests/test_basic.html
index b4daea79c9..a0464f631e 100644
--- a/dom/filesystem/tests/test_basic.html
+++ b/dom/filesystem/tests/test_basic.html
@@ -40,7 +40,7 @@ function create_fileList(aPath) {
script.sendAsyncMessage("dir.open", { path: aPath });
}
-function test_simpleFilePicker(aPath) {
+function test_simpleFilePicker() {
var url = SimpleTest.getTestFileURL("script_fileList.js");
var script = SpecialPowers.loadChromeScript(url);
diff --git a/dom/filesystem/tests/test_webkitdirectory.html b/dom/filesystem/tests/test_webkitdirectory.html
index 50080ad7ba..982887cbcf 100644
--- a/dom/filesystem/tests/test_webkitdirectory.html
+++ b/dom/filesystem/tests/test_webkitdirectory.html
@@ -48,7 +48,7 @@ function populateInputFile(aInputFile) {
var script = SpecialPowers.loadChromeScript(url);
var MockFilePicker = SpecialPowers.MockFilePicker;
- MockFilePicker.init(window, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
+ MockFilePicker.init(SpecialPowers.wrap(window).browsingContext, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
async function onOpened(message) {
MockFilePicker.useDirectory(message.dir);
@@ -134,7 +134,7 @@ async function test_individualSymlink(aInputFile) {
// -- Have the picker pick it
var MockFilePicker = SpecialPowers.MockFilePicker;
- MockFilePicker.init(window, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeOpen);
+ MockFilePicker.init(SpecialPowers.wrap(window).browsingContext, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeOpen);
MockFilePicker.displayDirectory = dir;
let pickerShown = new Promise(resolve => {
@@ -186,7 +186,7 @@ function test_changeDataWhileWorking() {
var script = SpecialPowers.loadChromeScript(url);
var MockFilePicker = SpecialPowers.MockFilePicker;
- MockFilePicker.init(window, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
+ MockFilePicker.init(SpecialPowers.wrap(window).browsingContext, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
let promptHandled;
// Let's start retrieving the root nsIFile object
@@ -203,7 +203,7 @@ function test_changeDataWhileWorking() {
// input.click() pointing to the root dir
.then(async function(aDir) {
MockFilePicker.cleanup();
- MockFilePicker.init(window, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
+ MockFilePicker.init(SpecialPowers.wrap(window).browsingContext, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
MockFilePicker.useDirectory(aDir);
var input = document.getElementById("inputFileDirectoryChange");
@@ -228,7 +228,7 @@ function test_changeDataWhileWorking() {
// Now let's click again and wait for onchange.
.then(async function(aDir) {
MockFilePicker.cleanup();
- MockFilePicker.init(window, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
+ MockFilePicker.init(SpecialPowers.wrap(window).browsingContext, "A Mock File Picker", SpecialPowers.Ci.nsIFilePicker.modeGetFolder);
MockFilePicker.useDirectory(aDir);
let input = document.getElementById("inputFileDirectoryChange");