Bug 1343172 - PBlob should not create a remoteInputStream if that already exists, r=smaug. a=gchang
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 18 Apr 2017 13:54:15 +0200
changeset 395953 cec324879dca4b7b0d6f41f0153679efeed07906
parent 395952 e0340a68ed92600930cb0d84b04da9dcbbe9b172
child 395954 9a10a8b7cf4f3bb0824e996bc9004e2c384af1f1
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, gchang
bugs1343172
milestone54.0
Bug 1343172 - PBlob should not create a remoteInputStream if that already exists, r=smaug. a=gchang
dom/file/ipc/Blob.cpp
--- a/dom/file/ipc/Blob.cpp
+++ b/dom/file/ipc/Blob.cpp
@@ -1084,16 +1084,20 @@ RemoteInputStream::SetStream(nsIInputStr
       mMonitor.Notify();
     }
   }
 }
 
 nsresult
 RemoteInputStream::BlockAndWaitForStream()
 {
+  if (mStream) {
+    return NS_OK;
+  }
+
   if (IsOnOwningThread()) {
     if (NS_IsMainThread()) {
       NS_WARNING("Blocking the main thread is not supported!");
       return NS_ERROR_FAILURE;
     }
 
     MOZ_ASSERT(IsWorkerStream());