Bug 975955 - Hold a cpu wakelock while playing video. r=roc

This commit is contained in:
Star Cheng 2014-03-18 16:44:41 +08:00
parent 7fa709fe4d
commit ba0e91c17e
2 changed files with 7 additions and 5 deletions

View File

@ -114,7 +114,7 @@ protected:
virtual void WakeLockCreate();
virtual void WakeLockRelease();
void WakeLockUpdate();
void UpdateScreenWakeLock();
nsRefPtr<WakeLock> mScreenWakeLock;

View File

@ -244,7 +244,7 @@ void
HTMLVideoElement::NotifyOwnerDocumentActivityChanged()
{
HTMLMediaElement::NotifyOwnerDocumentActivityChanged();
WakeLockUpdate();
UpdateScreenWakeLock();
}
already_AddRefed<VideoPlaybackQuality>
@ -281,17 +281,19 @@ HTMLVideoElement::GetVideoPlaybackQuality()
void
HTMLVideoElement::WakeLockCreate()
{
WakeLockUpdate();
HTMLMediaElement::WakeLockCreate();
UpdateScreenWakeLock();
}
void
HTMLVideoElement::WakeLockRelease()
{
WakeLockUpdate();
UpdateScreenWakeLock();
HTMLMediaElement::WakeLockRelease();
}
void
HTMLVideoElement::WakeLockUpdate()
HTMLVideoElement::UpdateScreenWakeLock()
{
bool hidden = OwnerDoc()->Hidden();