Bug 1343798 - Label runnables for HTMLTrackElement. r=jwwang

MozReview-Commit-ID: El7LXJFAHiM

--HG--
extra : rebase_source : 1f23f3d7cd09e30be9cfa191f6627bf1bacc115c
This commit is contained in:
bechen 2017-03-08 10:10:35 +08:00
parent 291e7ca6b4
commit f82170d314

View File

@ -433,12 +433,17 @@ HTMLTrackElement::SetReadyState(uint16_t aReadyState)
void
HTMLTrackElement::DispatchTrackRunnable(const nsString& aEventName)
{
nsIDocument* doc = OwnerDoc();
if (!doc) {
return;
}
nsCOMPtr<nsIRunnable> runnable =
NewRunnableMethod
<const nsString>(this,
&HTMLTrackElement::DispatchTrustedEvent,
aEventName);
NS_DispatchToMainThread(runnable);
doc->Dispatch("HTMLTrackElement::DispatchTrackRunnable",
TaskCategory::Other, runnable.forget());
}
void