• Andreas Haas's avatar
    [arraybuffer] Add checked ByteLength getter · 532ba437
    Andreas Haas authored
    V8 changes the size field of ArrayBuffers to {size_t}. Therefore an
    ArrayBuffer from V8 can overflow the size field of a blink::ArrayBuffer.
    With this CL we change the {ByteLength} getter of blink::ArrayBuffer to
    two new getters: {ByteLengthAsUnsigned} and {ByteLengthAsSizeT}.
    {ByteLengthAsUnsigned} includes an overflow check and is used for now
    for most existing accesses to {ByteLength}. Eventually we would like to
    change all calls to {ByteLengthAsSizeT}, so that eventually we can
    remove {ByteLengthAsUnsigned} and rename {ByteLengthAsSizeT} to
    {ByteLength} again.
    
    R=haraken@chromium.org
    
    Bug: v8:4153
    Change-Id: I1af532b8ef525b04e8e7f39147f4ab87f8e29082
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888831
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#713816}
    532ba437
usb_device.cc 38.9 KB