Bug 879717: Part 3 - Update screen wake lock when metadata has loaded. r=roc,esawin
☠☠ backed out by b2d92cb44873 ☠ ☠
authorAndreas Pehrson <pehrsons@gmail.com>
Sat, 04 Oct 2014 18:58:01 +0200
changeset 209018 cd7d8b93923f3fe80129955917d78e83ebce5da8
parent 209017 78b01186ff855234e43e2968afc9fd3bbc7e354b
child 209019 353aee81348432381174cb0957fc8f84661dc8c1
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc, esawin
bugs879717
milestone35.0a1
Bug 879717: Part 3 - Update screen wake lock when metadata has loaded. r=roc,esawin
content/html/content/src/HTMLMediaElement.cpp
--- a/content/html/content/src/HTMLMediaElement.cpp
+++ b/content/html/content/src/HTMLMediaElement.cpp
@@ -2928,16 +2928,21 @@ void HTMLMediaElement::MetadataLoaded(co
   // delete the VideoFrameContainer. This happens when the src is changed to an
   // audio only file.
   if (!aInfo->HasVideo() && mVideoFrameContainer) {
     // call ForgetElement() such that callbacks from |mVideoFrameContainer|
     // won't reach us anymore.
     mVideoFrameContainer->ForgetElement();
     mVideoFrameContainer = nullptr;
   }
+
+  if (IsVideo()) {
+    // Update the screen wakelock in case mHasVideo changed
+    NotifyOwnerDocumentActivityChanged();
+  }
 }
 
 void HTMLMediaElement::FirstFrameLoaded()
 {
   NS_ASSERTION(!mSuspendedAfterFirstFrame, "Should not have already suspended");
 
   ChangeDelayLoadStatus(false);
   UpdateReadyStateForData(NEXT_FRAME_UNAVAILABLE);