mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
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:
parent
fb83797145
commit
a97ec5bdeb
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user