mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1723723 - stop using getURLSpecFromFile from JS code to avoid mainthread IO, r=florian
Differential Revision: https://phabricator.services.mozilla.com/D121620
This commit is contained in:
parent
d9a5f40263
commit
4fa576deda
@ -2808,7 +2808,7 @@ var gMainPane = {
|
||||
var fph = Services.io
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
var urlSpec = fph.getURLSpecFromFile(aFile);
|
||||
var urlSpec = fph.getURLSpecFromActualFile(aFile);
|
||||
|
||||
return "moz-icon://" + urlSpec + "?size=16";
|
||||
},
|
||||
@ -3064,19 +3064,19 @@ var gMainPane = {
|
||||
downloadFolder.value = currentDirPref.value
|
||||
? `\u2066${currentDirPref.value.path}\u2069`
|
||||
: "";
|
||||
iconUrlSpec = fph.getURLSpecFromFile(currentDirPref.value);
|
||||
iconUrlSpec = fph.getURLSpecFromDir(currentDirPref.value);
|
||||
} else if (folderIndex == 1) {
|
||||
// 'Downloads'
|
||||
[downloadFolder.value] = await document.l10n.formatValues([
|
||||
{ id: "downloads-folder-name" },
|
||||
]);
|
||||
iconUrlSpec = fph.getURLSpecFromFile(await this._indexToFolder(1));
|
||||
iconUrlSpec = fph.getURLSpecFromDir(await this._indexToFolder(1));
|
||||
} else {
|
||||
// 'Desktop'
|
||||
[downloadFolder.value] = await document.l10n.formatValues([
|
||||
{ id: "desktop-folder-name" },
|
||||
]);
|
||||
iconUrlSpec = fph.getURLSpecFromFile(
|
||||
iconUrlSpec = fph.getURLSpecFromDir(
|
||||
await this._getDownloadsFolder("Desktop")
|
||||
);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ add_task(async function test() {
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
|
||||
let fileURL = fileHandler.getURLSpecFromFile(file);
|
||||
let fileURL = fileHandler.getURLSpecFromActualFile(file);
|
||||
|
||||
info("Opening url: " + fileURL);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, fileURL);
|
||||
|
@ -29,7 +29,7 @@ add_task(async function test() {
|
||||
.getProtocolHandler("file")
|
||||
.QueryInterface(Ci.nsIFileProtocolHandler);
|
||||
|
||||
let fileURL = fileHandler.getURLSpecFromFile(file);
|
||||
let fileURL = fileHandler.getURLSpecFromActualFile(file);
|
||||
|
||||
info("Opening url: " + fileURL);
|
||||
let tab = BrowserTestUtils.addTab(gBrowser, fileURL);
|
||||
|
@ -1032,7 +1032,7 @@ var TPS = {
|
||||
testFile,
|
||||
"testing/modules/ajv-4.1.1.js"
|
||||
);
|
||||
let ajvURL = fileProtocolHandler.getURLSpecFromFile(ajvFile);
|
||||
let ajvURL = fileProtocolHandler.getURLSpecFromActualFile(ajvFile);
|
||||
let ns = {};
|
||||
ChromeUtils.import(ajvURL, ns);
|
||||
let ajv = new ns.Ajv({ async: "co*" });
|
||||
|
@ -128,7 +128,7 @@ AppPicker.prototype = {
|
||||
return "";
|
||||
}
|
||||
|
||||
var urlSpec = fph.getURLSpecFromFile(file);
|
||||
var urlSpec = fph.getURLSpecFromActualFile(file);
|
||||
return "moz-icon://" + urlSpec + "?size=32";
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user