зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1331804 - Give runnable names to some generic dispatch sites (r=ehsan)
MozReview-Commit-ID: 83IL5zcor1W
This commit is contained in:
Родитель
80aaeed2fc
Коммит
5e4b276c5d
|
@ -4747,7 +4747,11 @@ nsresult
|
|||
WorkerPrivate::DispatchToMainThread(already_AddRefed<nsIRunnable> aRunnable,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
return mMainThreadEventTarget->Dispatch(Move(aRunnable), aFlags);
|
||||
nsCOMPtr<nsIRunnable> runnable = aRunnable;
|
||||
if (nsCOMPtr<nsINamed> named = do_QueryInterface(runnable)) {
|
||||
named->SetName("WorkerRunnable");
|
||||
}
|
||||
return mMainThreadEventTarget->Dispatch(runnable.forget(), aFlags);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -663,24 +663,28 @@ nsTimerImpl::GetName(nsACString& aName)
|
|||
aName.Assign(buf);
|
||||
} else {
|
||||
MOZ_ASSERT(mName.is<NameNothing>());
|
||||
aName.Truncate();
|
||||
aName.AssignLiteral("Anonymous callback timer");
|
||||
}
|
||||
break;
|
||||
|
||||
case CallbackType::Interface:
|
||||
if (nsCOMPtr<nsINamed> named = do_QueryInterface(mCallback.i)) {
|
||||
named->GetName(aName);
|
||||
} else {
|
||||
aName.AssignLiteral("Anonymous interface timer");
|
||||
}
|
||||
break;
|
||||
|
||||
case CallbackType::Observer:
|
||||
if (nsCOMPtr<nsINamed> named = do_QueryInterface(mCallback.o)) {
|
||||
named->GetName(aName);
|
||||
} else {
|
||||
aName.AssignLiteral("Anonymous observer timer");
|
||||
}
|
||||
break;
|
||||
|
||||
case CallbackType::Unknown:
|
||||
aName.Truncate();
|
||||
aName.AssignLiteral("Anonymous timer");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче