Bug 1365097 - Convert NS_GetCurrentThread uses in dom (except for dom/media) (r=smaug)
For the Quatum DOM project, it's better to work in terms of event targets than threads. This patch converts DOM code to operate on event targets rather than threads, when possible. MozReview-Commit-ID: 5FgvpKadUA2
This commit is contained in:
@@ -1375,9 +1375,9 @@ HTMLCanvasElement::OnVisibilityChange()
|
||||
};
|
||||
|
||||
RefPtr<nsIRunnable> runnable = new Runnable(mAsyncCanvasRenderer);
|
||||
nsCOMPtr<nsIThread> activeThread = mAsyncCanvasRenderer->GetActiveThread();
|
||||
if (activeThread) {
|
||||
activeThread->Dispatch(runnable, nsIThread::DISPATCH_NORMAL);
|
||||
nsCOMPtr<nsIEventTarget> activeTarget = mAsyncCanvasRenderer->GetActiveThread();
|
||||
if (activeTarget) {
|
||||
activeTarget->Dispatch(runnable, nsIThread::DISPATCH_NORMAL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -1417,9 +1417,9 @@ HTMLCanvasElement::OnMemoryPressure()
|
||||
};
|
||||
|
||||
RefPtr<nsIRunnable> runnable = new Runnable(mAsyncCanvasRenderer);
|
||||
nsCOMPtr<nsIThread> activeThread = mAsyncCanvasRenderer->GetActiveThread();
|
||||
if (activeThread) {
|
||||
activeThread->Dispatch(runnable, nsIThread::DISPATCH_NORMAL);
|
||||
nsCOMPtr<nsIEventTarget> activeTarget = mAsyncCanvasRenderer->GetActiveThread();
|
||||
if (activeTarget) {
|
||||
activeTarget->Dispatch(runnable, nsIThread::DISPATCH_NORMAL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user