Backed out changeset 7dfb5111a3a8 (bug 1413074) for failing browser-chrome's browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 03 Nov 2017 15:02:16 +0100
changeset 443319 4d3dc7f1d15d2794494bdb801551cd111b4c7fa3
parent 443318 b66649cd261a06335e8b052b1cab15b78744465e
child 443342 cbac4c5957cd88538d46a7cc0248c68149b83e5d
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1413074
milestone58.0a1
backs out7dfb5111a3a8bc78cabdfaca96c4d949e33bafdb
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
Backed out changeset 7dfb5111a3a8 (bug 1413074) for failing browser-chrome's browser/components/privatebrowsing/test/browser/browser_privatebrowsing_downloadLastDir.js r=backout on a CLOSED TREE
toolkit/content/contentAreaUtils.js
toolkit/mozapps/downloads/nsHelperAppDlg.js
--- a/toolkit/content/contentAreaUtils.js
+++ b/toolkit/content/contentAreaUtils.js
@@ -992,17 +992,17 @@ function getDefaultFileName(aDefaultFile
     } catch (e) {
       try {
         fileName = mhp.getParameter(aContentDisposition, "name", charset, true,
                                     dummy);
       } catch (e) {
       }
     }
     if (fileName)
-      return validateFileName(fileName);
+      return fileName;
   }
 
   let docTitle;
   if (aDocument && aDocument.title && aDocument.title.trim()) {
     // If the document looks like HTML or XML, try to use its original title.
     docTitle = validateFileName(aDocument.title);
     let contentType = aDocument.contentType;
     if (contentType == "application/xhtml+xml" ||
@@ -1038,17 +1038,17 @@ function getDefaultFileName(aDefaultFile
   // 6) If this is a directory, use the last directory name
   var path = aURI.pathQueryRef.match(/\/([^\/]+)\/$/);
   if (path && path.length > 1)
     return validateFileName(path[1]);
 
   try {
     if (aURI.host)
       // 7) Use the host.
-      return validateFileName(aURI.host);
+      return aURI.host;
   } catch (e) {
     // Some files have no information at all, like Javascript generated pages
   }
   try {
     // 8) Use the default file name
     return ContentAreaUtils.stringBundle.GetStringFromName("DefaultSaveFileName");
   } catch (e) {
     // in case localized string cannot be found
--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
@@ -202,18 +202,17 @@ nsUnknownContentTypeDialog.prototype = {
     let bundle =
       Services.strings.createBundle("chrome://mozapps/locale/downloads/unknownContentType.properties");
 
     Services.prompt.alert(this.dialog,
                    bundle.GetStringFromName("badPermissions.title"),
                    bundle.GetStringFromName("badPermissions"));
   },
 
-  promptForSaveToFileAsync: function(aLauncher, aContext, aDefaultFileName,
-                                     aSuggestedFileExtension, aForcePrompt) {
+  promptForSaveToFileAsync: function(aLauncher, aContext, aDefaultFile, aSuggestedFileExtension, aForcePrompt) {
     var result = null;
 
     this.mLauncher = aLauncher;
 
     let prefs = Components.classes["@mozilla.org/preferences-service;1"]
                           .getService(Components.interfaces.nsIPrefBranch);
     let bundle =
       Services.strings
@@ -256,18 +255,17 @@ nsUnknownContentTypeDialog.prototype = {
         let autodownload = prefs.getBoolPref(PREF_BD_USEDOWNLOADDIR, false);
 
         if (autodownload) {
           // Retrieve the user's default download directory
           let preferredDir = await Downloads.getPreferredDownloadsDirectory();
           let defaultFolder = new FileUtils.File(preferredDir);
 
           try {
-            result = this.validateLeafName(defaultFolder, aDefaultFileName,
-                                           aSuggestedFileExtension);
+            result = this.validateLeafName(defaultFolder, aDefaultFile, aSuggestedFileExtension);
           }
           catch (ex) {
             // When the default download directory is write-protected,
             // prompt the user for a different target file.
           }
 
           // Check to make sure we have a valid directory, otherwise, prompt
           if (result) {
@@ -281,17 +279,17 @@ nsUnknownContentTypeDialog.prototype = {
         }
       }
 
       // Use file picker to show dialog.
       var nsIFilePicker = Components.interfaces.nsIFilePicker;
       var picker = Components.classes["@mozilla.org/filepicker;1"].createInstance(nsIFilePicker);
       var windowTitle = bundle.GetStringFromName("saveDialogTitle");
       picker.init(parent, windowTitle, nsIFilePicker.modeSave);
-      picker.defaultString = this.getFinalLeafName(aDefaultFileName);
+      picker.defaultString = aDefaultFile;
 
       if (aSuggestedFileExtension) {
         // aSuggestedFileExtension includes the period, so strip it
         picker.defaultExtension = aSuggestedFileExtension.substring(1);
       }
       else {
         try {
           picker.defaultExtension = this.mLauncher.MIMEInfo.primaryExtension;