Bug 971664 - Assert for threadsafety issue in MediaRecorder. r=khuey
authorShelly Lin <slin@mozilla.com>
Wed, 19 Feb 2014 12:15:53 +0800
changeset 169916 4726ef9d760cee9b611232652bcf901e67816206
parent 169915 b217d48ad64430c6a51a2ff7bc5d2ea06cc53a9d
child 169917 47f9517744eaff3d6ce6ac42d44a2f8e5fb22e86
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewerskhuey
bugs971664
milestone30.0a1
Bug 971664 - Assert for threadsafety issue in MediaRecorder. r=khuey
content/media/MediaRecorder.cpp
--- a/content/media/MediaRecorder.cpp
+++ b/content/media/MediaRecorder.cpp
@@ -230,25 +230,29 @@ public:
 
     mStopIssued = true;
     CleanupStreams();
     nsContentUtils::UnregisterShutdownObserver(this);
   }
 
   nsresult Pause()
   {
-    NS_ENSURE_TRUE(NS_IsMainThread() && mTrackUnionStream, NS_ERROR_FAILURE);
+    MOZ_ASSERT(NS_IsMainThread());
+
+    NS_ENSURE_TRUE(mTrackUnionStream, NS_ERROR_FAILURE);
     mTrackUnionStream->ChangeExplicitBlockerCount(-1);
 
     return NS_OK;
   }
 
   nsresult Resume()
   {
-    NS_ENSURE_TRUE(NS_IsMainThread() && mTrackUnionStream, NS_ERROR_FAILURE);
+    MOZ_ASSERT(NS_IsMainThread());
+
+    NS_ENSURE_TRUE(mTrackUnionStream, NS_ERROR_FAILURE);
     mTrackUnionStream->ChangeExplicitBlockerCount(1);
 
     return NS_OK;
   }
 
   already_AddRefed<nsIDOMBlob> GetEncodedData()
   {
     return mEncodedBufferCache->ExtractBlob(mMimeType);