bug 1476514 rename WorkletImpl::TerminateThread to NotifyWorkletFinished r=baku

This is more appropriate when WorkletImpl will not necessarily create a thread.

Differential Revision: https://phabricator.services.mozilla.com/D13212

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2018-11-28 23:45:04 +00:00
parent ffd18ba6eb
commit cc08802d30
3 changed files with 8 additions and 9 deletions

View File

@ -436,7 +436,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(Worklet)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(Worklet)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
tmp->mImpl->TerminateThread();
tmp->mImpl->NotifyWorkletFinished();
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
@ -469,7 +469,7 @@ Worklet::Worklet(nsPIDOMWindowInner* aWindow, RefPtr<WorkletImpl> aImpl)
Worklet::~Worklet()
{
mImpl->TerminateThread();
mImpl->NotifyWorkletFinished();
}
JSObject*

View File

@ -92,15 +92,14 @@ WorkletImpl::GetOrCreateThread()
}
void
WorkletImpl::TerminateThread()
WorkletImpl::NotifyWorkletFinished()
{
MOZ_ASSERT(NS_IsMainThread());
if (!mWorkletThread) {
return;
}
mWorkletThread->Terminate();
mWorkletThread = nullptr;
if (mWorkletThread) {
mWorkletThread->Terminate();
mWorkletThread = nullptr;
}
mWorkletLoadInfo.mPrincipal = nullptr;
}

View File

@ -75,7 +75,7 @@ public:
JS::Handle<JSObject*> aGivenProto);
dom::WorkletThread* GetOrCreateThread();
void TerminateThread();
void NotifyWorkletFinished();
// Execution thread only.
already_AddRefed<dom::WorkletGlobalScope> CreateGlobalScope(JSContext* aCx);