Bug 1262053 - part8 : remove function NotifyOwnerDocumentActivityChangedInternal. r=cpearce

MozReview-Commit-ID: DnWgQHGJLU5

--HG--
extra : rebase_source : a6c4ab94fad22b2bef1bdde07bc17246943128f7
This commit is contained in:
Alastor Wu 2016-08-29 18:56:38 +08:00
parent 85c50bb3dd
commit 56e48dbbf5
4 changed files with 9 additions and 24 deletions

View File

@ -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()

View File

@ -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,

View File

@ -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*

View File

@ -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();