Bug 1302006. Part 2 - Let ShutdownState handle dormant request. r=kikuo
authorJW Wang <jwwang@mozilla.com>
Mon, 12 Sep 2016 10:34:35 +0800
changeset 314431 66359c23a6b6f49aeba4f6e88d9b53cc0a189a3d
parent 314430 7fb80e9897fa529df5925279623576fde86c195b
child 314432 c12f64bf259899d61108e556ac7bd437cd1d03d7
push id20574
push usercbook@mozilla.com
push dateTue, 20 Sep 2016 10:05:16 +0000
treeherderfx-team@14705f779a46 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskikuo
bugs1302006
milestone52.0a1
Bug 1302006. Part 2 - Let ShutdownState handle dormant request. r=kikuo MozReview-Commit-ID: 1uw7YjQps0i
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -534,16 +534,21 @@ public:
   {
     MOZ_DIAGNOSTIC_ASSERT(false, "Shouldn't escape the SHUTDOWN state.");
   }
 
   State GetState() const override
   {
     return DECODER_STATE_SHUTDOWN;
   }
+
+  bool HandleDormant(bool aDormant) override
+  {
+    return true;
+  }
 };
 
 #define INIT_WATCHABLE(name, val) \
   name(val, "MediaDecoderStateMachine::" #name)
 #define INIT_MIRROR(name, val) \
   name(mTaskQueue, val, "MediaDecoderStateMachine::" #name " (Mirror)")
 #define INIT_CANONICAL(name, val) \
   name(mTaskQueue, val, "MediaDecoderStateMachine::" #name " (Canonical)")
@@ -1493,20 +1498,16 @@ MediaDecoderStateMachine::DispatchSetDor
   OwnerThread()->Dispatch(r.forget());
 }
 
 void
 MediaDecoderStateMachine::SetDormant(bool aDormant)
 {
   MOZ_ASSERT(OnTaskQueue());
 
-  if (IsShutdown()) {
-    return;
-  }
-
   if (mStateObj->HandleDormant(aDormant)) {
     return;
   }
 
   // |mState == DECODER_STATE_DORMANT| is already
   // handled by |mStateObj->HandleDormant| above.
   MOZ_ASSERT(mState != DECODER_STATE_DORMANT);