Verified Commit 4c1edd7e authored by Karl Tomlinson's avatar Karl Tomlinson Committed by ma1
Browse files

Bug 2050380 Make shared memory transfer conditional on IsSharedMemoryAllowed() a=diannaS DONTBUILD

parent bea32e17
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -767,7 +767,10 @@ already_AddRefed<AudioWorkletNode> AudioWorkletNode::Constructor(
  // can share memory.
  JS::CloneDataPolicy cloneDataPolicy;
  cloneDataPolicy.allowIntraClusterClonableSharedObjects();
  nsIGlobalObject* currentGlobal = xpc::CurrentNativeGlobal(cx);
  if (currentGlobal->IsSharedMemoryAllowed()) {
    cloneDataPolicy.allowSharedMemoryObjects();
  }

  // StructuredCloneHolder does not have a move constructor.  Instead allocate
  // memory so that the pointer can be passed to the rendering thread.