Bug 1129877 - Fix one other remaining case of invoking Resolve/Reject directly on a Promise. v1 r=mattwoodrow a=lmandel
authorBobby Holley <bobbyholley@gmail.com>
Mon, 09 Feb 2015 18:38:11 -0800
changeset 249847 f1717862392963e008e094b8933c8b239f1928e6
parent 249846 81514026836140e8600bc6fa0c2d1f1de8058183
child 249848 9ca7d843248de1235a21830e9c854e7c1a05777f
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow, lmandel
bugs1129877
milestone37.0a2
Bug 1129877 - Fix one other remaining case of invoking Resolve/Reject directly on a Promise. v1 r=mattwoodrow a=lmandel
dom/media/MediaDecoderReader.cpp
--- a/dom/media/MediaDecoderReader.cpp
+++ b/dom/media/MediaDecoderReader.cpp
@@ -309,16 +309,15 @@ MediaDecoderReader::Shutdown()
   // out mTaskQueue, since otherwise any remaining tasks could crash when they
   // invoke GetTaskQueue()->IsCurrentThreadIn().
   if (mTaskQueue && !mTaskQueueIsBorrowed) {
     // If we own our task queue, shutdown ends when the task queue is done.
     p = mTaskQueue->BeginShutdown();
   } else {
     // If we don't own our task queue, we resolve immediately (though
     // asynchronously).
-    p = new ShutdownPromise(__func__);
-    p->Resolve(true, __func__);
+    p = ShutdownPromise::CreateAndResolve(true, __func__);
   }
 
   return p;
 }
 
 } // namespace mozilla