Bug 1331804 - New naming scheme for runnables (r=ehsan)

MozReview-Commit-ID: FOfrUXwGYws
This commit is contained in:
Bill McCloskey 2017-01-18 15:07:54 -08:00
Родитель 5986bb11fe
Коммит a1715e6737
7 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -5284,7 +5284,7 @@ nsDocument::UnblockDOMContentLoaded()
MOZ_RELEASE_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIRunnable> ev =
NewRunnableMethod(this, &nsDocument::DispatchContentLoadedEvents);
Dispatch("DispatchContentLoadedEvents", TaskCategory::Other, ev.forget());
Dispatch("nsDocument::DispatchContentLoadedEvents", TaskCategory::Other, ev.forget());
} else {
DispatchContentLoadedEvents();
}
@ -12059,7 +12059,7 @@ nsDocument::PostVisibilityUpdateEvent()
{
nsCOMPtr<nsIRunnable> event =
NewRunnableMethod(this, &nsDocument::UpdateVisibilityState);
Dispatch("UpdateVisibility", TaskCategory::Other, event.forget());
Dispatch("nsDocument::UpdateVisibilityState", TaskCategory::Other, event.forget());
}
void

Просмотреть файл

@ -8552,7 +8552,7 @@ nsGlobalWindow::PostMessageMozOuter(JSContext* aCx, JS::Handle<JS::Value> aMessa
return;
}
aError = Dispatch("PostMessage", TaskCategory::Other, event.forget());
aError = Dispatch("PostMessageEvent", TaskCategory::Other, event.forget());
}
void

Просмотреть файл

@ -1742,7 +1742,8 @@ public:
static void Dispatch(already_AddRefed<NotifyOffThreadScriptLoadCompletedRunnable>&& aSelf) {
RefPtr<NotifyOffThreadScriptLoadCompletedRunnable> self = aSelf;
RefPtr<DocGroup> docGroup = self->mDocGroup;
docGroup->Dispatch("OffThreadScriptLoader", TaskCategory::Other, self.forget());
docGroup->Dispatch("NotifyOffThreadScriptLoadCompletedRunnable",
TaskCategory::Other, self.forget());
}
NS_DECL_NSIRUNNABLE

Просмотреть файл

@ -68,14 +68,14 @@ AsyncEventDispatcher::PostDOMEvent()
RefPtr<AsyncEventDispatcher> ensureDeletionWhenFailing = this;
if (NS_IsMainThread()) {
if (nsCOMPtr<nsIGlobalObject> global = mTarget->GetOwnerGlobal()) {
return global->Dispatch("AsyncEvent", TaskCategory::Other, ensureDeletionWhenFailing.forget());
return global->Dispatch("AsyncEventDispatcher", TaskCategory::Other, ensureDeletionWhenFailing.forget());
}
// Sometimes GetOwnerGlobal returns null because it uses
// GetScriptHandlingObject rather than GetScopeObject.
if (nsCOMPtr<nsINode> node = do_QueryInterface(mTarget)) {
nsCOMPtr<nsIDocument> doc = node->OwnerDoc();
return doc->Dispatch("AsyncEvent", TaskCategory::Other, ensureDeletionWhenFailing.forget());
return doc->Dispatch("AsyncEventDispatcher", TaskCategory::Other, ensureDeletionWhenFailing.forget());
}
}
return NS_DispatchToCurrentThread(this);

Просмотреть файл

@ -7206,7 +7206,7 @@ HTMLMediaElement::AsyncResolvePendingPlayPromises()
= new nsResolveOrRejectPendingPlayPromisesRunner(this,
TakePendingPlayPromises());
OwnerDoc()->Dispatch("HTMLMediaElement::AsyncResolvePendingPlayPromises",
OwnerDoc()->Dispatch("nsResolveOrRejectPendingPlayPromisesRunner",
TaskCategory::Other,
event.forget());
}
@ -7223,7 +7223,7 @@ HTMLMediaElement::AsyncRejectPendingPlayPromises(nsresult aError)
TakePendingPlayPromises(),
aError);
OwnerDoc()->Dispatch("HTMLMediaElement::AsyncRejectPendingPlayPromises",
OwnerDoc()->Dispatch("nsResolveOrRejectPendingPlayPromisesRunner",
TaskCategory::Other,
event.forget());
}

Просмотреть файл

@ -1336,7 +1336,7 @@ nsHtml5StreamParser::FlushTreeOpsAndDisarmTimer()
}
mTreeBuilder->Flush();
nsCOMPtr<nsIRunnable> runnable(mExecutorFlusher);
if (NS_FAILED(mExecutor->GetDocument()->Dispatch("FlushTreeOpsAndDisarmTimer",
if (NS_FAILED(mExecutor->GetDocument()->Dispatch("nsHtml5ExecutorFlusher",
dom::TaskCategory::Other,
runnable.forget()))) {
NS_WARNING("failed to dispatch executor flush event");

Просмотреть файл

@ -265,7 +265,7 @@ nsHtml5TreeOpExecutor::ContinueInterruptedParsingAsync()
{
if (!mDocument || !mDocument->IsInBackgroundWindow()) {
nsCOMPtr<nsIRunnable> flusher = new nsHtml5ExecutorReflusher(this);
if (NS_FAILED(mDocument->Dispatch("ContinueInterruptedParsingAsync",
if (NS_FAILED(mDocument->Dispatch("nsHtml5ExecutorReflusher",
dom::TaskCategory::Other,
flusher.forget()))) {
NS_WARNING("failed to dispatch executor flush event");