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:
@@ -384,7 +384,7 @@ WebCryptoTask::DispatchWithPromise(Promise* aResultPromise)
|
||||
}
|
||||
|
||||
// Store calling thread
|
||||
mOriginalThread = NS_GetCurrentThread();
|
||||
mOriginalEventTarget = GetCurrentThreadSerialEventTarget();
|
||||
|
||||
// If we are running on a worker thread we must hold the worker
|
||||
// alive while we work on the thread pool. Otherwise the worker
|
||||
@@ -419,7 +419,7 @@ WebCryptoTask::Run()
|
||||
}
|
||||
|
||||
// Back to the original thread, i.e. continue below.
|
||||
mOriginalThread->Dispatch(this, NS_DISPATCH_NORMAL);
|
||||
mOriginalEventTarget->Dispatch(this, NS_DISPATCH_NORMAL);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -3729,7 +3729,7 @@ WebCryptoTask::WebCryptoTask()
|
||||
: CancelableRunnable("WebCryptoTask")
|
||||
, mEarlyRv(NS_OK)
|
||||
, mEarlyComplete(false)
|
||||
, mOriginalThread(nullptr)
|
||||
, mOriginalEventTarget(nullptr)
|
||||
, mReleasedNSSResources(false)
|
||||
, mRv(NS_ERROR_NOT_INITIALIZED)
|
||||
{
|
||||
@@ -3745,7 +3745,7 @@ WebCryptoTask::~WebCryptoTask()
|
||||
}
|
||||
|
||||
if (mWorkerHolder) {
|
||||
NS_ProxyRelease(mOriginalThread, mWorkerHolder.forget());
|
||||
NS_ProxyRelease(mOriginalEventTarget, mWorkerHolder.forget());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user