mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 983293 - Part 4: Pass ReadyState variables to AddTextTrack methods and TextTrack ctors. r=cpearce
This makes it more clear what part of the code is triggering the ReadyState to be what it is. I.E. Tracks added through the HTMLMediaElement::AddTextTrack method should have a ReadyState of "Loaded" and so it's more clear for function to specify that. Vice versa for TrackElements which add TextTracks with a default ReadyState of "None".
This commit is contained in:
parent
fffd5328cf
commit
4b465b49a2
@ -3951,6 +3951,7 @@ HTMLMediaElement::AddTextTrack(TextTrackKind aKind,
|
||||
if (mTextTrackManager) {
|
||||
return mTextTrackManager->AddTextTrack(aKind, aLabel, aLanguage,
|
||||
TextTrackMode::Hidden,
|
||||
TextTrackReadyState::Loaded,
|
||||
TextTrackSource::AddTextTrack);
|
||||
}
|
||||
return nullptr;
|
||||
|
@ -154,7 +154,9 @@ HTMLTrackElement::CreateTextTrack()
|
||||
}
|
||||
|
||||
mTrack = new TextTrack(OwnerDoc()->GetParentObject(), kind, label, srcLang,
|
||||
TextTrackMode::Disabled, TextTrackSource::Track);
|
||||
TextTrackMode::Disabled,
|
||||
TextTrackReadyState::NotLoaded,
|
||||
TextTrackSource::Track);
|
||||
mTrack->SetTrackElement(this);
|
||||
|
||||
if (mMediaParent) {
|
||||
|
@ -113,15 +113,15 @@ already_AddRefed<TextTrack>
|
||||
TextTrackManager::AddTextTrack(TextTrackKind aKind, const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource)
|
||||
{
|
||||
if (!mMediaElement) {
|
||||
return nullptr;
|
||||
}
|
||||
nsRefPtr<TextTrack> ttrack =
|
||||
mTextTracks->AddTextTrack(aKind, aLabel, aLanguage, aMode, aTextTrackSource,
|
||||
CompareTextTracks(mMediaElement));
|
||||
ttrack->SetReadyState(TextTrackReadyState::Loaded);
|
||||
mTextTracks->AddTextTrack(aKind, aLabel, aLanguage, aMode, aReadyState,
|
||||
aTextTrackSource, CompareTextTracks(mMediaElement));
|
||||
AddCues(ttrack);
|
||||
return ttrack.forget();
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource);
|
||||
void AddTextTrack(TextTrack* aTextTrack);
|
||||
void RemoveTextTrack(TextTrack* aTextTrack, bool aPendingListOnly);
|
||||
|
@ -34,6 +34,7 @@ TextTrack::TextTrack(nsISupports* aParent,
|
||||
const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource)
|
||||
: mParent(aParent)
|
||||
, mTextTrackSource(aTextTrackSource)
|
||||
@ -43,6 +44,7 @@ TextTrack::TextTrack(nsISupports* aParent,
|
||||
mLabel = aLabel;
|
||||
mLanguage = aLanguage;
|
||||
mMode = aMode;
|
||||
mReadyState = aReadyState;
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
@ -52,6 +54,7 @@ TextTrack::TextTrack(nsISupports* aParent,
|
||||
const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource)
|
||||
: mParent(aParent)
|
||||
, mTextTrackList(aTextTrackList)
|
||||
@ -62,6 +65,7 @@ TextTrack::TextTrack(nsISupports* aParent,
|
||||
mLabel = aLabel;
|
||||
mLanguage = aLanguage;
|
||||
mMode = aMode;
|
||||
mReadyState = aReadyState;
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource);
|
||||
TextTrack(nsISupports* aParent,
|
||||
TextTrackList* aTextTrackList,
|
||||
@ -54,6 +55,7 @@ public:
|
||||
const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource);
|
||||
|
||||
void SetDefaultSettings();
|
||||
|
@ -66,11 +66,13 @@ TextTrackList::AddTextTrack(TextTrackKind aKind,
|
||||
const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource,
|
||||
const CompareTextTracks& aCompareTT)
|
||||
{
|
||||
nsRefPtr<TextTrack> track = new TextTrack(mGlobal, this, aKind, aLabel, aLanguage,
|
||||
aMode, aTextTrackSource);
|
||||
nsRefPtr<TextTrack> track = new TextTrack(mGlobal, this, aKind, aLabel,
|
||||
aLanguage, aMode, aReadyState,
|
||||
aTextTrackSource);
|
||||
AddTextTrack(track, aCompareTT);
|
||||
return track.forget();
|
||||
}
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
const nsAString& aLabel,
|
||||
const nsAString& aLanguage,
|
||||
TextTrackMode aMode,
|
||||
TextTrackReadyState aReadyState,
|
||||
TextTrackSource aTextTrackSource,
|
||||
const CompareTextTracks& aCompareTT);
|
||||
TextTrack* GetTrackById(const nsAString& aId);
|
||||
|
Loading…
Reference in New Issue
Block a user