Bug 1208316 - Notify watchers on StreamListener::Forget(). r?jib draft
authorAndreas Pehrson <pehrsons@gmail.com>
Tue, 13 Sep 2016 10:42:28 +0200
changeset 432208 d3c5f3d3e787c184630841e57390833b019f7265
parent 432207 ccaf05cd7343a22464d17bacf722c3c84734898a
child 432209 02c1dc36a03f05ae8fcba2a8674308ec01d45b65
push id34233
push userbmo:pehrson@telenordigital.com
push dateTue, 01 Nov 2016 13:21:40 +0000
reviewersjib
bugs1208316
milestone52.0a1
Bug 1208316 - Notify watchers on StreamListener::Forget(). r?jib This makes sense because the result of StreamListener::NextFrameStatus depends on mElement. MozReview-Commit-ID: 8W7nGLpRxE1
dom/html/HTMLMediaElement.cpp
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -3866,17 +3866,21 @@ public:
     WatchTarget(aName),
     mElement(aElement),
     mHaveCurrentData(false),
     mBlocked(false),
     mFinished(false),
     mMutex(aName),
     mPendingNotifyOutput(false)
   {}
-  void Forget() { mElement = nullptr; }
+  void Forget()
+  {
+    mElement = nullptr;
+    NotifyWatchers();
+  }
 
   // Main thread
 
   MediaDecoderOwner::NextFrameStatus NextFrameStatus()
   {
     if (!mElement || !mHaveCurrentData || mFinished) {
       return MediaDecoderOwner::NEXT_FRAME_UNAVAILABLE;
     }