mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 836045 - Update Webapps code to use the new deviceStorage stat() support r=djf
This commit is contained in:
parent
9c7dfa41cd
commit
34f7f84329
@ -44,13 +44,13 @@ this.FreeSpaceWatcher = {
|
|||||||
try {
|
try {
|
||||||
let deviceStorage = Services.wm.getMostRecentWindow("navigator:browser")
|
let deviceStorage = Services.wm.getMostRecentWindow("navigator:browser")
|
||||||
.navigator.getDeviceStorage("apps");
|
.navigator.getDeviceStorage("apps");
|
||||||
let req = deviceStorage.stat();
|
let req = deviceStorage.freeSpace();
|
||||||
req.onsuccess = req.onerror = function statResult(e) {
|
req.onsuccess = req.onerror = function statResult(e) {
|
||||||
if (!e.target.result) {
|
if (!e.target.result) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let freeBytes = e.target.result.freeBytes;
|
let freeBytes = e.target.result;
|
||||||
debug("Free bytes: " + freeBytes);
|
debug("Free bytes: " + freeBytes);
|
||||||
let newStatus = freeBytes > aThreshold;
|
let newStatus = freeBytes > aThreshold;
|
||||||
if (newStatus != callback.currentStatus) {
|
if (newStatus != callback.currentStatus) {
|
||||||
|
@ -2265,7 +2265,7 @@ this.DOMApplicationRegistry = {
|
|||||||
|
|
||||||
let deviceStorage = Services.wm.getMostRecentWindow("navigator:browser")
|
let deviceStorage = Services.wm.getMostRecentWindow("navigator:browser")
|
||||||
.navigator.getDeviceStorage("apps");
|
.navigator.getDeviceStorage("apps");
|
||||||
let req = deviceStorage.stat();
|
let req = deviceStorage.freeSpace();
|
||||||
req.onsuccess = req.onerror = function statResult(e) {
|
req.onsuccess = req.onerror = function statResult(e) {
|
||||||
// Even if we could not retrieve the device storage free space, we try
|
// Even if we could not retrieve the device storage free space, we try
|
||||||
// to download the package.
|
// to download the package.
|
||||||
@ -2274,7 +2274,7 @@ this.DOMApplicationRegistry = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let freeBytes = e.target.result.freeBytes;
|
let freeBytes = e.target.result;
|
||||||
if (freeBytes) {
|
if (freeBytes) {
|
||||||
debug("Free storage: " + freeBytes + ". Download size: " +
|
debug("Free storage: " + freeBytes + ". Download size: " +
|
||||||
aApp.downloadSize);
|
aApp.downloadSize);
|
||||||
|
Loading…
Reference in New Issue
Block a user