dvWebWorkerCapability function
What a browser's workers are.
Implementation
DVWorkerCapability dvWebWorkerCapability({
required bool hasWorker,
required bool crossOriginIsolated,
}) {
if (!hasWorker) return const DVWorkerCapability.inline();
return DVWorkerCapability(
mechanism: DVWorkerMechanism.webWorker,
// SharedArrayBuffer exists only on a cross-origin-isolated page.
sharedMemory: crossOriginIsolated,
zeroCopyNative: false,
note: crossOriginIsolated
? 'input crosses by structured clone; a SharedArrayBuffer is shared'
: 'input is copied to the worker by structured clone; shared memory '
'needs a cross-origin-isolated page (COOP and COEP headers)',
);
}