mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 15:58:39 +09:00
Issue #2197 - Part 1a: postMessages should have transferable as [] by default
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1336020
This commit is contained in:
parent
7c759b2c21
commit
438cdbd913
22 changed files with 52 additions and 58 deletions
|
|
@ -190,7 +190,7 @@ private:
|
|||
|
||||
void
|
||||
ServiceWorkerClient::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
||||
const Optional<Sequence<JS::Value>>& aTransferable,
|
||||
const Sequence<JS::Value>& aTransferable,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate();
|
||||
|
|
@ -198,12 +198,10 @@ ServiceWorkerClient::PostMessage(JSContext* aCx, JS::Handle<JS::Value> aMessage,
|
|||
workerPrivate->AssertIsOnWorkerThread();
|
||||
|
||||
JS::Rooted<JS::Value> transferable(aCx, JS::UndefinedValue());
|
||||
if (aTransferable.WasPassed()) {
|
||||
const Sequence<JS::Value>& realTransferable = aTransferable.Value();
|
||||
|
||||
if (!aTransferable.IsEmpty()) {
|
||||
JS::HandleValueArray elements =
|
||||
JS::HandleValueArray::fromMarkedLocation(realTransferable.Length(),
|
||||
realTransferable.Elements());
|
||||
JS::HandleValueArray::fromMarkedLocation(aTransferable.Length(),
|
||||
aTransferable.Elements());
|
||||
|
||||
JSObject* array = JS_NewArrayObject(aCx, elements);
|
||||
if (!array) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue