Bug 1343172 - PBlob should not create a remoteInputStream if that already exists. r=smaug, a=ritu
authorAndrea Marchesini <amarchesini@mozilla.com>
Tue, 18 Apr 2017 13:54:15 +0200
changeset 578484 c7b064f6b93aa0af228a53052c72cfc8760b1b92
parent 578483 3a747480ead177402f8a1b9dc6cfa249401c5da6
child 578485 1d86e96610a1c431b8a10f35306d66804177dc92
push id58939
push userbmo:cku@mozilla.com
push dateTue, 16 May 2017 04:17:59 +0000
reviewerssmaug, ritu
bugs1343172
milestone52.1.2
Bug 1343172 - PBlob should not create a remoteInputStream if that already exists. r=smaug, a=ritu
dom/ipc/Blob.cpp
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -1068,16 +1068,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());