[Webkit-unassigned] [Bug 183082] New: Can't transfer arraybuffer to service worker

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Feb 23 06:52:44 PST 2018


https://bugs.webkit.org/show_bug.cgi?id=183082

            Bug ID: 183082
           Summary: Can't transfer arraybuffer to service worker
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Service Workers
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: Ms2ger at igalia.com

Problem seems to be that MessageWithMessagePorts::{encode,decode} don't handle the transferred array buffers, only the serialization and MessagePorts.

Test case:

<!doctype html>
<script src=/resources/testharness.js>
</script>
<script>
promise_test(async t => {
  let reg = await navigator.serviceWorker.register("/tmp/sw.js");
  const ab = new ArrayBuffer(8);
  let sw = reg.installing || reg.waiting || reg.active;
  sw.postMessage(ab, [ab]);
  await new Promise((res, rej) => {
    navigator.serviceWorker.onmessage = e => rej(e.data);
  });
})
</script>


self.addEventListener('message', function(event) {
  event.source.postMessage(`${event.data}`);
})

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180223/aa27edaa/attachment-0001.html>


More information about the webkit-unassigned mailing list