mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1262053 - part8 : remove function NotifyOwnerDocumentActivityChangedInternal. r=cpearce
MozReview-Commit-ID: DnWgQHGJLU5 --HG-- extra : rebase_source : a6c4ab94fad22b2bef1bdde07bc17246943128f7
This commit is contained in:
parent
85c50bb3dd
commit
56e48dbbf5
@ -1399,7 +1399,7 @@ void HTMLMediaElement::NotifyMediaStreamTracksAvailable(DOMMediaStream* aStream)
|
||||
if (videoHasChanged) {
|
||||
// We are a video element and HasVideo() changed so update the screen
|
||||
// wakelock
|
||||
NotifyOwnerDocumentActivityChangedInternal();
|
||||
NotifyOwnerDocumentActivityChanged();
|
||||
}
|
||||
|
||||
mWatchManager.ManualNotify(&HTMLMediaElement::UpdateReadyStateInternal);
|
||||
@ -2923,7 +2923,7 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
mPaused.SetOuter(this);
|
||||
|
||||
RegisterActivityObserver();
|
||||
NotifyOwnerDocumentActivityChangedInternal();
|
||||
NotifyOwnerDocumentActivityChanged();
|
||||
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mWatchManager.Watch(mDownloadSuspendedByCache, &HTMLMediaElement::UpdateReadyStateInternal);
|
||||
@ -3858,7 +3858,7 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
|
||||
|
||||
// We may want to suspend the new stream now.
|
||||
// This will also do an AddRemoveSelfReference.
|
||||
NotifyOwnerDocumentActivityChangedInternal();
|
||||
NotifyOwnerDocumentActivityChanged();
|
||||
UpdateAudioChannelPlayingState();
|
||||
|
||||
if (!mPaused) {
|
||||
@ -4344,7 +4344,7 @@ void HTMLMediaElement::MetadataLoaded(const MediaInfo* aInfo,
|
||||
|
||||
if (IsVideo() && aInfo->HasVideo()) {
|
||||
// We are a video element playing video so update the screen wakelock
|
||||
NotifyOwnerDocumentActivityChangedInternal();
|
||||
NotifyOwnerDocumentActivityChanged();
|
||||
}
|
||||
|
||||
if (mDefaultPlaybackStartPosition != 0.0) {
|
||||
@ -5299,13 +5299,6 @@ bool HTMLMediaElement::IsBeingDestroyed()
|
||||
}
|
||||
|
||||
void HTMLMediaElement::NotifyOwnerDocumentActivityChanged()
|
||||
{
|
||||
// TODO : merge NotifyOwnerDocumentActivityChangedInternal in following patch.
|
||||
NotifyOwnerDocumentActivityChangedInternal();
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLMediaElement::NotifyOwnerDocumentActivityChangedInternal()
|
||||
{
|
||||
bool visible = !IsHidden();
|
||||
if (visible) {
|
||||
@ -5324,8 +5317,6 @@ HTMLMediaElement::NotifyOwnerDocumentActivityChangedInternal()
|
||||
SuspendOrResumeElement(pauseElement, !IsActive());
|
||||
|
||||
AddRemoveSelfReference();
|
||||
|
||||
return pauseElement;
|
||||
}
|
||||
|
||||
void HTMLMediaElement::AddRemoveSelfReference()
|
||||
|
@ -161,12 +161,7 @@ public:
|
||||
* Call this to reevaluate whether we should start/stop due to our owner
|
||||
* document being active, inactive, visible or hidden.
|
||||
*/
|
||||
void NotifyOwnerDocumentActivityChanged();
|
||||
|
||||
// This method does the work necessary for the
|
||||
// NotifyOwnerDocumentActivityChanged() notification. It returns true if the
|
||||
// media element was paused as a result.
|
||||
virtual bool NotifyOwnerDocumentActivityChangedInternal();
|
||||
virtual void NotifyOwnerDocumentActivityChanged();
|
||||
|
||||
// Called by the video decoder object, on the main thread,
|
||||
// when it has read the metadata containing video dimensions,
|
||||
|
@ -221,12 +221,11 @@ HTMLVideoElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
|
||||
return HTMLVideoElementBinding::Wrap(aCx, this, aGivenProto);
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLVideoElement::NotifyOwnerDocumentActivityChangedInternal()
|
||||
void
|
||||
HTMLVideoElement::NotifyOwnerDocumentActivityChanged()
|
||||
{
|
||||
bool pauseElement = HTMLMediaElement::NotifyOwnerDocumentActivityChangedInternal();
|
||||
HTMLMediaElement::NotifyOwnerDocumentActivityChanged();
|
||||
UpdateScreenWakeLock();
|
||||
return pauseElement;
|
||||
}
|
||||
|
||||
FrameStatistics*
|
||||
|
@ -128,7 +128,7 @@ public:
|
||||
|
||||
void SetMozUseScreenWakeLock(bool aValue);
|
||||
|
||||
bool NotifyOwnerDocumentActivityChangedInternal() override;
|
||||
void NotifyOwnerDocumentActivityChanged() override;
|
||||
|
||||
// Gives access to the decoder's frame statistics, if present.
|
||||
FrameStatistics* GetFrameStatistics();
|
||||
|
Loading…
Reference in New Issue
Block a user