Skip to content

Commit

Permalink
Bug 1820210 - Worker improvements. r=dom-worker-reviewers,edenchuang
Browse files Browse the repository at this point in the history
  • Loading branch information
asutherland committed Apr 17, 2023
1 parent a0254f2 commit 9b5dd97
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dom/workers/Worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void Worker::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
if (!mWorkerPrivate || mWorkerPrivate->ParentStatusProtected() > Running) {
return;
}
RefPtr<WorkerPrivate> workerPrivate = mWorkerPrivate;

JS::Rooted<JS::Value> transferable(aCx, JS::UndefinedValue());

Expand Down Expand Up @@ -145,6 +146,10 @@ void Worker::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,

runnable->Write(aCx, aMessage, transferable, clonePolicy, aRv);

if (!mWorkerPrivate || mWorkerPrivate->ParentStatusProtected() > Running) {
return;
}

if (isTimelineRecording) {
end = MakeUnique<WorkerTimelineMarker>(
NS_IsMainThread()
Expand Down

0 comments on commit 9b5dd97

Please sign in to comment.