Bug 991977 - Ensure volume is mounted before starting download. r=dhylands
authorHansu Kim <hansu9866@gmail.com>
Wed, 23 Apr 2014 17:50:00 -0400
changeset 181479 c5d205aa662cb1203698587ecccb1bd2ca28154c
parent 181478 1f9bd75bb71441ad1083c69b8e7c0804fcffce8b
child 181480 5eeea833ae7179269afdcab5aceac322c95fea6e
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersdhylands
bugs991977
milestone32.0a1
Bug 991977 - Ensure volume is mounted before starting download. r=dhylands
toolkit/components/jsdownloads/src/DownloadIntegration.jsm
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -279,20 +279,17 @@ this.DownloadIntegration = {
         if (aStorage.default || !preferredStorageName) {
           preferredStorageName = aStorage.storageName;
         }
       });
 
       // Now get the path for this storage area.
       if (preferredStorageName) {
         let volume = volumeService.getVolumeByName(preferredStorageName);
-        if (volume &&
-            volume.isMediaPresent &&
-            !volume.isMountLocked &&
-            !volume.isSharing) {
+        if (volume && volume.state === Ci.nsIVolume.STATE_MOUNTED){
           directoryPath = OS.Path.join(volume.mountPoint, "downloads");
           yield OS.File.makeDir(directoryPath, { ignoreExisting: true });
         }
       }
       if (directoryPath) {
         throw new Task.Result(directoryPath);
       } else {
         throw new Components.Exception("No suitable storage for downloads.",