Bug 1044598 - Followup to add already_AddRefed<Session> locals to MediaRecorder.cpp to fix explicit-constructor issues. r=bustage in a CLOSED TREE, will get someone else to look at post-landing
authorJeff Walden <jwalden@mit.edu>
Tue, 29 Jul 2014 12:39:02 -0700
changeset 196618 b0dd336a76c8e9462ae2ddeacbc83d63afee0a47
parent 196617 5e50fb773dffbd8f36fbc58b8376ba1356ec1c0c
child 196619 b05b6fe7524ed20c658b5a416c938537bbec62ef
push id46929
push userjwalden@mit.edu
push dateTue, 29 Jul 2014 19:39:22 +0000
treeherdermozilla-inbound@b0dd336a76c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1044598
milestone34.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
Bug 1044598 - Followup to add already_AddRefed<Session> locals to MediaRecorder.cpp to fix explicit-constructor issues. r=bustage in a CLOSED TREE, will get someone else to look at post-landing
content/media/MediaRecorder.cpp
--- a/content/media/MediaRecorder.cpp
+++ b/content/media/MediaRecorder.cpp
@@ -449,17 +449,18 @@ private:
         return;
       }
     }
 
     // In case source media stream does not notify track end, recieve
     // shutdown notification and stop Read Thread.
     nsContentUtils::RegisterShutdownObserver(this);
 
-    nsRefPtr<nsIRunnable> event = new ExtractRunnable(this);
+    already_AddRefed<Session> session(this); // addref in MediaRecorder::Start
+    nsRefPtr<nsIRunnable> event = new ExtractRunnable(Move(session));
     if (NS_FAILED(mReadThread->Dispatch(event, NS_DISPATCH_NORMAL))) {
       NS_WARNING("Failed to dispatch ExtractRunnable at beginning");
     }
   }
   // application should get blob and onstop event
   void DoSessionEndTask(nsresult rv)
   {
     MOZ_ASSERT(NS_IsMainThread());
@@ -467,17 +468,18 @@ private:
       mRecorder->NotifyError(rv);
     }
 
     CleanupStreams();
     if (NS_FAILED(NS_DispatchToMainThread(new PushBlobRunnable(this)))) {
       MOZ_ASSERT(false, "NS_DispatchToMainThread PushBlobRunnable failed");
     }
     // Destroy this session object in main thread.
-    if (NS_FAILED(NS_DispatchToMainThread(new DestroyRunnable(this)))) {
+    already_AddRefed<Session> session(this); // addref in MediaRecorder::Start
+    if (NS_FAILED(NS_DispatchToMainThread(new DestroyRunnable(Move(session))))) {
       MOZ_ASSERT(false, "NS_DispatchToMainThread DestroyRunnable failed");
     }
   }
   void CleanupStreams()
   {
     if (mInputPort.get()) {
       mInputPort->Destroy();
       mInputPort = nullptr;