Issue #2197 - Part 2b: Implement StructuredSerializeOptions for Worker

Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1502802
This commit is contained in:
FranklinDM 2023-04-07 16:30:32 +08:00 committed by roytam1
commit 158784cbed
8 changed files with 56 additions and 2 deletions

View file

@ -542,6 +542,15 @@ DedicatedWorkerGlobalScope::PostMessage(JSContext* aCx,
mWorkerPrivate->PostMessageToParent(aCx, aMessage, aTransferable, aRv);
}
void
DedicatedWorkerGlobalScope::PostMessage(JSContext* aCx,
JS::Handle<JS::Value> aMessage,
const StructuredSerializeOptions& aOptions,
ErrorResult& aRv)
{
PostMessage(aCx, aMessage, aOptions.mTransfer, aRv);
}
SharedWorkerGlobalScope::SharedWorkerGlobalScope(WorkerPrivate* aWorkerPrivate,
const nsCString& aName)
: WorkerGlobalScope(aWorkerPrivate), mName(aName)