Commit 871f1d82 authored by Emanuel Ziegler's avatar Emanuel Ziegler Committed by Commit Bot

[CredentialManagement] Replace deprecatedByteLengthAsUnsigned

This CL replaces calls to deprecatedByteLengthAsUnsigned by calls to
byteLengthAsSizeT. Since the value is only used for comparison, the
implicit upcast to size_t will be rejecting too large sizes.

This are only the trivial fixes, the complex fixes are covered in
bug chromium:1030717.

Background: we prepare ArrayBuffers to be bigger than 4GB. Therefore we
changed the size field to size_t. Now we are changing all uses of
ByteLength to be able to deal with size_t, either by accepting a size_t,
or by throwing an exception if the size is too big.

R=mkwst@chromium.org

Bug: chromium:1008840
Change-Id: Ic6e4a07b55b1c0f37a31c8ab1de41c183032de60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1964591Reviewed-by: default avatarMike West <mkwst@chromium.org>
Commit-Queue: Emanuel Ziegler <ecmziegler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726385}
parent 704ae621
......@@ -174,13 +174,12 @@ Vector<uint8_t> ConvertFixedSizeArray(
const blink::ArrayBufferOrArrayBufferView& buffer,
unsigned length) {
if (buffer.IsArrayBuffer() &&
(buffer.GetAsArrayBuffer()->DeprecatedByteLengthAsUnsigned() != length)) {
(buffer.GetAsArrayBuffer()->ByteLengthAsSizeT() != length)) {
return Vector<uint8_t>();
}
if (buffer.IsArrayBufferView() &&
buffer.GetAsArrayBufferView().View()->deprecatedByteLengthAsUnsigned() !=
length) {
buffer.GetAsArrayBufferView().View()->byteLengthAsSizeT() != length) {
return Vector<uint8_t>();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment