• Shu-yu Guo's avatar
    [shared-struct] Rework ValueSerializer::Delegate::SupportsSharedValues · d855d7f7
    Shu-yu Guo authored
    This CL has two changes:
    
    1. Remove ValueDeserializer::Delegate::SupportsSharedValues. Only
       ValueSerializer::Delegate needs to report whether it supports
       serializing shared values. The ValueDeserializer::Delegate should
       DCHECK if it gets a shared object tag but it doesn't support it.
       This better mirrors what happens with SharedArrayBuffer transfers
       currently.
    
    2. When attempting to serialize a shared object (shared struct, shared
       array, Atomics.Mutex, or Atomics.Condition) when
       !SupportsSharedValues(), throw instead of assert. This is for better
       ergonomics.
    
    Bug: v8:12547
    Change-Id: I2bb66830393526578016813c4e3488859dd07073
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3866302
    Commit-Queue: Camillo Bruni <cbruni@chromium.org>
    Auto-Submit: Shu-yu Guo <syg@chromium.org>
    Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
    Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#82870}
    d855d7f7
value-serializer.cc 93.1 KB