Merge remote-tracking branch 'origin/tracking' into custom

This commit is contained in:
roytam1 2023-09-20 09:31:36 +08:00
commit 30236b0f05
40 changed files with 722 additions and 213 deletions

View file

@ -664,7 +664,8 @@ public:
NS_IMETHOD Run() override
{
MOZ_ASSERT(mPerformance);
mPerformance->NotifyObservers();
RefPtr<Performance> performance(mPerformance);
performance->NotifyObservers();
return NS_OK;
}
@ -688,7 +689,12 @@ Performance::RunNotificationObserversTask()
{
mPendingNotificationObserversTask = true;
nsCOMPtr<nsIRunnable> task = new NotifyObserversTask(this);
nsresult rv = NS_DispatchToCurrentThread(task);
nsresult rv;
if (NS_IsMainThread()) {
rv = NS_DispatchToCurrentThread(task);
} else {
rv = NS_DispatchToMainThread(task);
}
if (NS_WARN_IF(NS_FAILED(rv))) {
mPendingNotificationObserversTask = false;
}