Bug 782351 - Device Storage - Expose sdcard/volume state flag on stat result followup. If fetching the available disk space fails (due to a path not existing), return zero bytes available. r=khuey
authorDoug Turner <dougt@dougt.org>
Thu, 16 Aug 2012 16:14:38 -0700
changeset 105734 57c7f49b37b3e996ed9f101eb6b136378570ebed
parent 105733 431d680e9e2f0e0c410ee3bd6d422960d5637276
child 105735 83c15a039a0940c4c072207e723e060215c374d8
push id1989
push userakeybl@mozilla.com
push dateTue, 28 Aug 2012 00:20:43 +0000
treeherdermozilla-aurora@a8e95ae10ea7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs782351
milestone17.0a1
Bug 782351 - Device Storage - Expose sdcard/volume state flag on stat result followup. If fetching the available disk space fails (due to a path not existing), return zero bytes available. r=khuey
dom/devicestorage/nsDeviceStorage.cpp
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -1067,22 +1067,20 @@ public:
 
   ~StatFileEvent() {}
 
   NS_IMETHOD Run()
   {
     NS_ASSERTION(!NS_IsMainThread(), "Wrong thread!");
     nsCOMPtr<nsIRunnable> r;
     PRUint64 diskUsage = DeviceStorageFile::DirectoryDiskUsage(mFile->mFile);
-    PRInt64 freeSpace = 0;
+    PRInt64 freeSpace;
     nsresult rv = mFile->mFile->GetDiskSpaceAvailable(&freeSpace);
     if (NS_FAILED(rv)) {
-      r = new PostErrorEvent(mRequest, POST_ERROR_EVENT_UNKNOWN, mFile);
-      NS_DispatchToMainThread(r);
-      return NS_OK;
+      freeSpace = 0;
     }
 
     r = new PostStatResultEvent(mRequest, diskUsage, freeSpace);
     NS_DispatchToMainThread(r);
     return NS_OK;
   }
 
 private: