mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
Bug 1343799 - lable runnables in texttracklist.cpp. r=jwwang
MozReview-Commit-ID: 39MmwAMaDdk --HG-- extra : rebase_source : 9630f72f1e0e44df551fdab42f10c4d02f5357e6
This commit is contained in:
parent
ba6513e929
commit
0d95383399
@ -7,6 +7,7 @@
|
||||
#include "mozilla/dom/TextTrackListBinding.h"
|
||||
#include "mozilla/dom/TrackEvent.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "mozilla/dom/TextTrackCue.h"
|
||||
#include "mozilla/dom/TextTrackManager.h"
|
||||
|
||||
@ -174,6 +175,11 @@ TextTrackList::CreateAndDispatchChangeEvent()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (!mPendingTextTrackChange) {
|
||||
nsPIDOMWindowInner* win = GetOwner();
|
||||
if (!win) {
|
||||
return;
|
||||
}
|
||||
|
||||
mPendingTextTrackChange = true;
|
||||
RefPtr<Event> event = NS_NewDOMEvent(this, nullptr, nullptr);
|
||||
|
||||
@ -181,7 +187,9 @@ TextTrackList::CreateAndDispatchChangeEvent()
|
||||
event->SetTrusted(true);
|
||||
|
||||
nsCOMPtr<nsIRunnable> eventRunner = new ChangeEventRunner(this, event);
|
||||
NS_DispatchToMainThread(eventRunner);
|
||||
nsGlobalWindow::Cast(win)->Dispatch(
|
||||
"TextTrackList::CreateAndDispatchChangeEvent", TaskCategory::Other,
|
||||
eventRunner.forget());
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user