mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1445540 - Use IsCurrentThreadRunningWorker() instead of GetCurrentThreadWorkerPrivate() in dom/base and dom/promise, r=smaug
This commit is contained in:
parent
8f9c41b092
commit
5a4303000d
@ -89,7 +89,7 @@ public:
|
||||
, mEncodeCompleteCallback(aEncodeCompleteCallback)
|
||||
, mFailed(false)
|
||||
{
|
||||
if (!NS_IsMainThread() && GetCurrentThreadWorkerPrivate()) {
|
||||
if (!NS_IsMainThread() && IsCurrentThreadRunningWorker()) {
|
||||
mCreationEventTarget = GetCurrentThreadEventTarget();
|
||||
} else {
|
||||
mCreationEventTarget = GetMainThreadEventTarget();
|
||||
|
@ -646,11 +646,8 @@ PromiseWorkerProxy::~PromiseWorkerProxy()
|
||||
void
|
||||
PromiseWorkerProxy::CleanProperties()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
||||
MOZ_ASSERT(worker);
|
||||
worker->AssertIsOnWorkerThread();
|
||||
#endif
|
||||
MOZ_ASSERT(IsCurrentThreadRunningWorker());
|
||||
|
||||
// Ok to do this unprotected from Create().
|
||||
// CleanUp() holds the lock before calling this.
|
||||
mCleanedUp = true;
|
||||
@ -699,11 +696,7 @@ PromiseWorkerProxy::GetWorkerPrivate() const
|
||||
Promise*
|
||||
PromiseWorkerProxy::WorkerPromise() const
|
||||
{
|
||||
#ifdef DEBUG
|
||||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
||||
MOZ_ASSERT(worker);
|
||||
worker->AssertIsOnWorkerThread();
|
||||
#endif
|
||||
MOZ_ASSERT(IsCurrentThreadRunningWorker());
|
||||
MOZ_ASSERT(mWorkerPromise);
|
||||
return mWorkerPromise;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user