commit fcc53d9fa4969850b4cd77951974ee6db73e827b
Author: Georg Koppen <gk(a)torproject.org>
Date: Tue Feb 12 08:49:33 2019 +0000
Revert "Bug 29180: MAR download stalls when about dialog is opened"
This reverts commit 9ca60802516a3f693f6ae22e9df6994aab67c5f9.
We don't want to ship a new Torbutton but it contains language strings
we need.
---
browser/base/content/aboutDialog-appUpdater.js | 17 +++++-----------
toolkit/mozapps/update/content/updates.js | 27 ++++++++++++--------------
2 files changed, 17 insertions(+), 27 deletions(-)
diff --git a/browser/base/content/aboutDialog-appUpdater.js b/browser/base/content/aboutDialog-appUpdater.js
index b732db6bee6b..e81098a1e898 100644
--- a/browser/base/content/aboutDialog-appUpdater.js
+++ b/browser/base/content/aboutDialog-appUpdater.js
@@ -318,18 +318,11 @@ appUpdater.prototype =
this.update.QueryInterface(Ci.nsIWritablePropertyBag);
this.update.setProperty("foregroundDownload", "true");
- // If one is not already in progress, start a download. Previously,
- // we would pause and restart an existing download in case there was
- // a need to transition from a background download to a foreground one,
- // but that caused Tor bug 29180. There is no difference between a
- // foreground and background download unless the update manifest
- // includes a backgroundInterval attribute.
- if (!this.isDownloading) {
- let state = this.aus.downloadUpdate(this.update, false);
- if (state == "failed") {
- this.selectPanel("downloadFailed");
- return;
- }
+ this.aus.pauseDownload();
+ let state = this.aus.downloadUpdate(this.update, false);
+ if (state == "failed") {
+ this.selectPanel("downloadFailed");
+ return;
}
this.setupDownloadingUI();
diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js
index 195265ff81f9..5b6ae7cc6ba1 100644
--- a/toolkit/mozapps/update/content/updates.js
+++ b/toolkit/mozapps/update/content/updates.js
@@ -751,22 +751,19 @@ var gDownloadingPage = {
gUpdates.update.QueryInterface(Ci.nsIWritablePropertyBag);
gUpdates.update.setProperty("foregroundDownload", "true");
- // If it is not already in progress, start the download. See
- // Tor bug 29180 as well as the longer comment in the startDownload()
- // function within browser/base/content/aboutDialog-appUpdater.js.
- if (!aus.isDownloading) {
- var state = aus.downloadUpdate(gUpdates.update, false);
- if (state == "failed") {
- // We've tried as hard as we could to download a valid update -
- // we fell back from a partial patch to a complete patch and even
- // then we couldn't validate. Show a validation error with
- // instructions on how to manually update.
- this.cleanUp();
- gUpdates.wiz.goTo("errors");
- return;
- }
+ // Pause any active background download and restart it as a foreground
+ // download.
+ aus.pauseDownload();
+ var state = aus.downloadUpdate(gUpdates.update, false);
+ if (state == "failed") {
+ // We've tried as hard as we could to download a valid update -
+ // we fell back from a partial patch to a complete patch and even
+ // then we couldn't validate. Show a validation error with instructions
+ // on how to manually update.
+ this.cleanUp();
+ gUpdates.wiz.goTo("errors");
+ return;
}
-
// Add this UI as a listener for active downloads
aus.addDownloadListener(this);