mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Bug 1285897 - Async dispatch cuechange event on TextTrack object. r=rillian
MozReview-Commit-ID: DKWCAEaT58J --HG-- extra : transplant_source : %F4%CAT%AD%05v%A4%94%B8%13%2C%8E%9Ex%DDg%89Q%CFR
This commit is contained in:
parent
b7387e8701
commit
c610f50aae
@ -740,7 +740,7 @@ TextTrackManager::TimeMarchesOn()
|
||||
for (uint32_t i = 0; i < affectedTracks.Length(); ++i) {
|
||||
TextTrack* ttrack = affectedTracks[i];
|
||||
if (ttrack) {
|
||||
ttrack->DispatchTrustedEvent(NS_LITERAL_STRING("cuechange"));
|
||||
ttrack->DispatchAsyncTrustedEvent(NS_LITERAL_STRING("cuechange"));
|
||||
HTMLTrackElement* trackElement = ttrack->GetTrackElement();
|
||||
if (trackElement) {
|
||||
trackElement->DispatchTrackRunnable(NS_LITERAL_STRING("cuechange"));
|
||||
|
@ -318,5 +318,16 @@ TextTrack::GetLanguage(nsAString& aLanguage) const
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
TextTrack::DispatchAsyncTrustedEvent(const nsString& aEventName)
|
||||
{
|
||||
RefPtr<TextTrack> self = this;
|
||||
NS_DispatchToMainThread(
|
||||
NS_NewRunnableFunction([self, aEventName]() {
|
||||
self->DispatchTrustedEvent(aEventName);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
@ -116,6 +116,8 @@ public:
|
||||
|
||||
void NotifyCueUpdated(TextTrackCue *aCue);
|
||||
|
||||
void DispatchAsyncTrustedEvent(const nsString& aEventName);
|
||||
|
||||
private:
|
||||
~TextTrack();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user