Bug 1578623 permit SerializeStack() from worklet thread r=baku

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Karl Tomlinson 2019-09-09 00:41:48 +00:00
parent fb83797145
commit a97ec5bdeb
2 changed files with 7 additions and 6 deletions

View File

@ -27,9 +27,9 @@ void SerializedStackHolder::WriteStack(JSContext* aCx,
JS_ClearPendingException(aCx);
}
void SerializedStackHolder::SerializeMainThreadStack(JSContext* aCx,
JS::HandleObject aStack) {
MOZ_ASSERT(NS_IsMainThread());
void SerializedStackHolder::SerializeMainThreadOrWorkletStack(
JSContext* aCx, JS::HandleObject aStack) {
MOZ_ASSERT(!IsCurrentThreadRunningWorker());
WriteStack(aCx, aStack);
}
@ -59,7 +59,7 @@ void SerializedStackHolder::SerializeCurrentStack(JSContext* aCx) {
if (stack) {
if (NS_IsMainThread()) {
SerializeMainThreadStack(aCx, stack);
SerializeMainThreadOrWorkletStack(aCx, stack);
} else {
WorkerPrivate* currentWorker = GetCurrentThreadWorkerPrivate();
SerializeWorkerStack(aCx, currentWorker, stack);

View File

@ -30,8 +30,9 @@ class SerializedStackHolder {
public:
SerializedStackHolder();
// Fill this holder with a main thread stack.
void SerializeMainThreadStack(JSContext* aCx, JS::HandleObject aStack);
// Fill this holder with a main or worklet thread stack.
void SerializeMainThreadOrWorkletStack(JSContext* aCx,
JS::HandleObject aStack);
// Fill this holder with a worker thread stack.
void SerializeWorkerStack(JSContext* aCx, WorkerPrivate* aWorkerPrivate,