Bug 1267933. Part 2 - add comments per comment 5. r=gerald.
authorJW Wang <jwwang@mozilla.com>
Thu, 05 May 2016 10:29:06 +0800
changeset 296154 945893b62336d110c88f12b102502cf13361799e
parent 296153 0b4b01734a94feeea56dc3ae8359b01d8523f9f1
child 296155 5137c2a0f917f3ac094441915b1321724226f3c4
push id76226
push userjwwang@mozilla.com
push dateThu, 05 May 2016 02:33:46 +0000
treeherdermozilla-inbound@945893b62336 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1267933
milestone49.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 1267933. Part 2 - add comments per comment 5. r=gerald. MozReview-Commit-ID: 5mRVvwoWOEE
dom/media/MediaDecoder.cpp
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -641,17 +641,18 @@ MediaDecoder::Shutdown()
 
     mWatchManager.Unwatch(mIsAudioDataAudible, &MediaDecoder::NotifyAudibleStateChanged);
 
     mDecoderStateMachine->BeginShutdown()
       ->Then(AbstractThread::MainThread(), __func__, this,
              &MediaDecoder::FinishShutdown,
              &MediaDecoder::FinishShutdown);
   } else {
-    // Ensure we always unregister MediaShutdownManager asynchronously.
+    // Ensure we always unregister asynchronously in order not to disrupt
+    // the hashtable iterating in MediaShutdownManager::Shutdown().
     RefPtr<MediaDecoder> self = this;
     nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([self] () {
       MediaShutdownManager::Instance().Unregister(self);
     });
     AbstractThread::MainThread()->Dispatch(r.forget());
   }
 
   // Force any outstanding seek and byterange requests to complete