Bug 1820210 - Worker improvements. r=dom-worker-reviewers,edenchuang

Differential Revision: https://phabricator.services.mozilla.com/D171779
This commit is contained in:
Andrew Sutherland 2023-04-17 23:57:53 +00:00
Родитель a225e191c6
Коммит c0b696292a
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -86,6 +86,8 @@ void Worker::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
if (!mWorkerPrivate || mWorkerPrivate->ParentStatusProtected() > Running) {
return;
}
RefPtr<WorkerPrivate> workerPrivate = mWorkerPrivate;
Unused << workerPrivate;
JS::Rooted<JS::Value> transferable(aCx, JS::UndefinedValue());
@ -145,6 +147,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()