Backout f6af3c44e395 (bug 810208) for crashes on a CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Wed, 02 Jan 2013 21:32:36 +0000
changeset 126488 888109be06e19f2871869af1c82f22c680b26acf
parent 126487 eed2a6f242433d6f701dace4cb54a5ae5d436112
child 126489 442f07c8dd02db01a8603b0e69d20ea889bce157
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs810208
milestone20.0a1
backs outf6af3c44e395937f66be7c32429506f263ca0908
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout f6af3c44e395 (bug 810208) for crashes on a CLOSED TREE
browser/components/downloads/src/DownloadsUI.js
mobile/android/components/DownloadManagerUI.js
mobile/xul/components/DownloadManagerUI.js
toolkit/components/downloads/nsDownloadManager.cpp
toolkit/components/downloads/nsDownloadManagerUI.js
toolkit/components/downloads/nsDownloadProxy.h
toolkit/components/downloads/nsIDownloadManagerUI.idl
uriloader/exthandler/tests/unit_ipc/test_encoding.js
--- a/browser/components/downloads/src/DownloadsUI.js
+++ b/browser/components/downloads/src/DownloadsUI.js
@@ -55,45 +55,45 @@ DownloadsUI.prototype = {
   //////////////////////////////////////////////////////////////////////////////
   //// nsISupports
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIDownloadManagerUI]),
 
   //////////////////////////////////////////////////////////////////////////////
   //// nsIDownloadManagerUI
 
-  show: function DUI_show(aWindowContext, aID, aReason, aUsePrivateUI)
+  show: function DUI_show(aWindowContext, aID, aReason)
   {
     if (DownloadsCommon.useToolkitUI) {
-      this._toolkitUI.show(aWindowContext, aID, aReason, aUsePrivateUI);
+      this._toolkitUI.show(aWindowContext, aID, aReason);
       return;
     }
 
     if (!aReason) {
       aReason = Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED;
     }
 
     if (aReason == Ci.nsIDownloadManagerUI.REASON_NEW_DOWNLOAD) {
       const kMinimized = Ci.nsIDOMChromeWindow.STATE_MINIMIZED;
       let browserWin = gBrowserGlue.getMostRecentBrowserWindow();
 
       if (!browserWin || browserWin.windowState == kMinimized) {
-        this._showDownloadManagerUI(aWindowContext, aID, aReason, aUsePrivateUI);
+        this._showDownloadManagerUI(aWindowContext, aID, aReason);
       }
       else {
         // If the indicator is visible, then new download notifications are
         // already handled by the panel service.
         browserWin.DownloadsButton.checkIsVisible(function(isVisible) {
           if (!isVisible) {
-            this._showDownloadManagerUI(aWindowContext, aID, aReason, aUsePrivateUI);
+            this._showDownloadManagerUI(aWindowContext, aID, aReason);
           }
         }.bind(this));
       }
     } else {
-      this._showDownloadManagerUI(aWindowContext, aID, aReason, aUsePrivateUI);
+      this._showDownloadManagerUI(aWindowContext, aID, aReason);
     }
   },
 
   get visible()
   {
     // If we're still using the toolkit downloads manager, delegate the call
     // to it. Otherwise, return true for now, until we decide on how we want
     // to indicate that a new download has started if a browser window is
@@ -107,23 +107,23 @@ DownloadsUI.prototype = {
       this._toolkitUI.getAttention();
     }
   },
 
   /**
    * Helper function that opens the download manager UI.
    */
   _showDownloadManagerUI:
-  function DUI_showDownloadManagerUI(aWindowContext, aID, aReason, aUsePrivateUI)
+  function DUI_showDownloadManagerUI(aWindowContext, aID, aReason)
   {
     // If we weren't given a window context, try to find a browser window
     // to use as our parent - and if that doesn't work, error out and give up.
     let parentWindow = aWindowContext;
     if (!parentWindow) {
-      parentWindow = RecentWindow.getMostRecentBrowserWindow({ private: !!aUsePrivateUI });
+      parentWindow = RecentWindow.getMostRecentBrowserWindow();
       if (!parentWindow) {
         Components.utils.reportError(
           "Couldn't find a browser window to open the Places Downloads View " +
           "from.");
         return;
       }
     }
 
--- a/mobile/android/components/DownloadManagerUI.js
+++ b/mobile/android/components/DownloadManagerUI.js
@@ -11,17 +11,17 @@ Components.utils.import("resource://gre/
 // Download Manager UI
 // -----------------------------------------------------------------------
 
 function DownloadManagerUI() { }
 
 DownloadManagerUI.prototype = {
   classID: Components.ID("{93db15b1-b408-453e-9a2b-6619e168324a}"),
 
-  show: function show(aWindowContext, aID, aReason, aUsePrivateUI) {
+  show: function show(aWindowContext, aID, aReason) {
     if (!aReason)
       aReason = Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED;
 
     let browser = Services.wm.getMostRecentWindow("navigator:browser");
     if (browser)
       browser.showDownloadManager(aWindowContext, aID, aReason);
   },
 
--- a/mobile/xul/components/DownloadManagerUI.js
+++ b/mobile/xul/components/DownloadManagerUI.js
@@ -11,17 +11,17 @@ Components.utils.import("resource://gre/
 // Download Manager UI
 // -----------------------------------------------------------------------
 
 function DownloadManagerUI() { }
 
 DownloadManagerUI.prototype = {
   classID: Components.ID("{93db15b1-b408-453e-9a2b-6619e168324a}"),
 
-  show: function show(aWindowContext, aID, aReason, aUsePrivateUI) {
+  show: function show(aWindowContext, aID, aReason) {
     if (!aReason)
       aReason = Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED;
 
     let browser = Services.wm.getMostRecentWindow("navigator:browser");
     if (browser)
       browser.showDownloadManager(aWindowContext, aID, aReason);
   },
 
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -2474,21 +2474,22 @@ nsDownloadManager::Observe(nsISupports *
     (void)PauseAllDownloads(true);
   }
   else if (strcmp(aTopic, NS_IOSERVICE_OFFLINE_STATUS_TOPIC) == 0 &&
            nsDependentString(aData).EqualsLiteral(NS_IOSERVICE_ONLINE)) {
     // We can now resume all downloads that are supposed to auto-resume.
     (void)ResumeAllDownloads(false);
   }
   else if (strcmp(aTopic, "alertclickcallback") == 0) {
+    //TODO: This doens't make sense when clicking a notification related to
+    //      private downloads when per-window mode is enabled. (bug 810208)
     nsCOMPtr<nsIDownloadManagerUI> dmui =
       do_GetService("@mozilla.org/download-manager-ui;1", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
-    return dmui->Show(nullptr, 0, nsIDownloadManagerUI::REASON_USER_INTERACTED,
-                      NS_strcmp(aData, NS_LITERAL_STRING("private").get()) == 0);
+    return dmui->Show(nullptr, 0, nsIDownloadManagerUI::REASON_USER_INTERACTED);
   } else if (strcmp(aTopic, "sleep_notification") == 0 ||
              strcmp(aTopic, "suspend_process_notification") == 0) {
     // Pause downloads if we're sleeping, and mark the downloads as auto-resume
     (void)PauseAllDownloads(true);
   } else if (strcmp(aTopic, "wake_notification") == 0 ||
              strcmp(aTopic, "resume_process_notification") == 0) {
     int32_t resumeOnWakeDelay = 10000;
     nsCOMPtr<nsIPrefBranch> pref = do_GetService(NS_PREFSERVICE_CONTRACTID);
@@ -2770,19 +2771,18 @@ nsDownload::SetState(DownloadState aStat
                 mDownloadManager->GetRetentionBehavior() == 0;
 
               // If downloads are automatically removed per the user's
               // retention policy, there's no reason to make the text clickable
               // because if it is, they'll click open the download manager and
               // the items they downloaded will have been removed.
               alerts->ShowAlertNotification(
                   NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
-                  message, !removeWhenDone,
-                  mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
-                  mDownloadManager, EmptyString());
+                  message, !removeWhenDone, EmptyString(), mDownloadManager,
+                  EmptyString());
             }
         }
       }
 
 #if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK2)
       nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
       nsCOMPtr<nsIFile> file;
       nsAutoString path;
--- a/toolkit/components/downloads/nsDownloadManagerUI.js
+++ b/toolkit/components/downloads/nsDownloadManagerUI.js
@@ -19,17 +19,17 @@ const PREF_FLASH_COUNT = "browser.downlo
 function nsDownloadManagerUI() {}
 
 nsDownloadManagerUI.prototype = {
   classID: Components.ID("7dfdf0d1-aff6-4a34-bad1-d0fe74601642"),
 
   //////////////////////////////////////////////////////////////////////////////
   //// nsIDownloadManagerUI
 
-  show: function show(aWindowContext, aID, aReason, aUsePrivateUI)
+  show: function show(aWindowContext, aID, aReason)
   {
     if (!aReason)
       aReason = Ci.nsIDownloadManagerUI.REASON_USER_INTERACTED;
 
     // First we see if it is already visible
     let window = this.recentWindow;
     if (window) {
       window.focus();
--- a/toolkit/components/downloads/nsDownloadProxy.h
+++ b/toolkit/components/downloads/nsDownloadProxy.h
@@ -65,17 +65,17 @@ public:
 
       bool focusWhenStarting = true;
       if (branch)
         (void)branch->GetBoolPref(PREF_BDM_FOCUSWHENSTARTING, &focusWhenStarting);
 
       if (visible && !focusWhenStarting)
         return NS_OK;
 
-      return dmui->Show(nullptr, id, nsIDownloadManagerUI::REASON_NEW_DOWNLOAD, aIsPrivate);
+      return dmui->Show(nullptr, id, nsIDownloadManagerUI::REASON_NEW_DOWNLOAD);
     }
     return rv;
   }
 
   NS_IMETHODIMP OnStateChange(nsIWebProgress* aWebProgress,
                               nsIRequest* aRequest, uint32_t aStateFlags,
                               nsresult aStatus)
   {
--- a/toolkit/components/downloads/nsIDownloadManagerUI.idl
+++ b/toolkit/components/downloads/nsIDownloadManagerUI.idl
@@ -1,16 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 interface nsIInterfaceRequestor;
 
-[scriptable, uuid(bc54ef90-5215-11e2-bcfd-0800200c9a66)]
+[scriptable, uuid(ca7663d5-69e3-4c4a-b754-f462bd36b05f)]
 interface nsIDownloadManagerUI : nsISupports {
   /**
    * The reason that should be passed when the user requests to show the
    * download manager's UI.
    */
   const short REASON_USER_INTERACTED = 0;
 
   /**
@@ -25,24 +25,20 @@ interface nsIDownloadManagerUI : nsISupp
   * @param [optional] aWindowContext
   *        The parent window context to show the UI.
   * @param [optional] aID
   *        The id of the download to be preselected upon opening.
   * @param [optional] aReason
   *        The reason to show the download manager's UI.  This defaults to
   *        REASON_USER_INTERACTED, and should be one of the previously listed
   *        constants.
-  * @param [optional] aUsePrivateUI
-  *        Pass true as this argument to hint to the implementation that it
-  *        should only display private downloads in the UI, if possible.
   */
   void show([optional] in nsIInterfaceRequestor aWindowContext,
             [optional] in unsigned long aID,
-            [optional] in short aReason,
-            [optional] in boolean aUsePrivateUI);
+            [optional] in short aReason);
 
  /**
   * Indicates if the UI is visible or not.
   */
   readonly attribute boolean visible;
 
  /**
   * Brings attention to the UI if it is already visible
--- a/uriloader/exthandler/tests/unit_ipc/test_encoding.js
+++ b/uriloader/exthandler/tests/unit_ipc/test_encoding.js
@@ -53,17 +53,17 @@ let DownloadListener = {
   }
 }
 DownloadListener.init();
 
 function HelperAppDlg() { }
 HelperAppDlg.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIHelperAppLauncherDialog]),
   contractID: "@mozilla.org/helperapplauncherdialog;1",
-  show: function (launcher, ctx, reason, usePrivateUI) {
+  show: function (launcher, ctx, reason) {
     launcher.MIMEInfo.preferredAction = Ci.nsIMIMEInfo.saveToFile;
     launcher.launchWithApplication(null, false);
   },
 
   promptForSaveToFile: function (launcher, ctx, defaultFile, suggestedExtension, forcePrompt) { }
 }
 
 // Stolen from XPCOMUtils, since this handy function is not public there