Merge m-c to inbound.
authorRyan VanderMeulen <ryanvm@gmail.com>
Wed, 24 Apr 2013 21:51:04 -0400
changeset 140767 722048a0587b6dbef660dd9ae2431f0563aa191a
parent 140766 c1f983b78f1625fee2d390906ea263bb94ea2f9e (current diff)
parent 140750 690b5e0f6562fef80ae3bfadf33ad05e36fc0595 (diff)
child 140768 064b6605f850da00d7b7e48ffd717ca877314cfc
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone23.0a1
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
Merge m-c to inbound.
--- a/b2g/test/emulator.manifest
+++ b/b2g/test/emulator.manifest
@@ -1,6 +1,6 @@
 [{
-"size": 647503948,
-"digest": "9ba4f195052e0d5eaae734375aed52f52b7b3337fa8caf01a61830529266e282be19697095c88135379c984d7242ec36b384cf81155176bb6527e6621f32eed3",
+"size": 659020310,
+"digest": "8201020a5214337cf19d43bb3fde8c4624d7a7a71f04a4522a34783194694fe5e66f8087acf6fe7080d7bf787b8311dd9ed8facfbac39198d0121f817b8eef32",
 "algorithm": "sha512",
 "filename": "emulator.zip"
 }]
--- a/dom/devicestorage/DeviceStorageRequestParent.cpp
+++ b/dom/devicestorage/DeviceStorageRequestParent.cpp
@@ -651,17 +651,21 @@ DeviceStorageRequestParent::PostAvailabl
 nsresult
 DeviceStorageRequestParent::PostAvailableResultEvent::CancelableRun()
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   nsString state;
   state.Assign(NS_LITERAL_STRING("available"));
 #ifdef MOZ_WIDGET_GONK
-  nsresult rv = GetSDCardStatus(mFile->mPath, state);
+  nsString path;
+  nsresult rv = mFile->mFile->GetPath(path);
+  if (NS_SUCCEEDED(rv)) {
+    rv = GetSDCardStatus(path, state);
+  }
   if (NS_FAILED(rv)) {
     state.Assign(NS_LITERAL_STRING("unavailable"));
   }
 #endif
 
   AvailableStorageResponse response(state);
   unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -1323,45 +1323,49 @@ nsDOMDeviceStorageCursor::RequestComplet
 {
   NS_ASSERTION(!mOkToCallContinue, "mOkToCallContinue must be false");
   mOkToCallContinue = true;
 }
 
 class PostAvailableResultEvent : public nsRunnable
 {
 public:
-  PostAvailableResultEvent(const nsAString& aPath, DOMRequest* aRequest)
-    : mPath(aPath)
+  PostAvailableResultEvent(DeviceStorageFile *aFile, DOMRequest* aRequest)
+    : mFile(aFile)
     , mRequest(aRequest)
   {
   }
 
   ~PostAvailableResultEvent() {}
 
   NS_IMETHOD Run()
   {
     NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
     nsString state;
     state.Assign(NS_LITERAL_STRING("available"));
 #ifdef MOZ_WIDGET_GONK
-    nsresult rv = GetSDCardStatus(mPath, state);
+    nsString path;
+    nsresult rv = mFile->mFile->GetPath(path);
+    if (NS_SUCCEEDED(rv)) {
+      rv = GetSDCardStatus(path, state);
+    }
     if (NS_FAILED(rv)) {
       state.Assign(NS_LITERAL_STRING("unavailable"));
     }
 #endif
 
     JS::Value result = StringToJsval(mRequest->GetOwner(), state);
     mRequest->FireSuccess(result);
     mRequest = nullptr;
     return NS_OK;
   }
 
 private:
-  nsString mPath;
+  nsRefPtr<DeviceStorageFile> mFile;
   nsRefPtr<DOMRequest> mRequest;
 };
 
 class PostResultEvent : public nsRunnable
 {
 public:
   PostResultEvent(nsRefPtr<DOMRequest>& aRequest, DeviceStorageFile* aFile)
     : mFile(aFile)
@@ -1838,17 +1842,17 @@ public:
       case DEVICE_STORAGE_REQUEST_AVAILABLE:
       {
         if (XRE_GetProcessType() != GeckoProcessType_Default) {
           PDeviceStorageRequestChild* child = new DeviceStorageRequestChild(mRequest, mFile);
           DeviceStorageAvailableParams params(mFile->mStorageType, mFile->mPath);
           ContentChild::GetSingleton()->SendPDeviceStorageRequestConstructor(child, params);
           return NS_OK;
         }
-        r = new PostAvailableResultEvent(mFile->mPath, mRequest);
+        r = new PostAvailableResultEvent(mFile, mRequest);
         NS_DispatchToMainThread(r);
         return NS_OK;
       }
 
       case DEVICE_STORAGE_REQUEST_WATCH:
       {
         mDeviceStorage->mAllowedToWatchFile = true;
         return NS_OK;