Commit 6200ac2b authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[arraybuffer] Create backing store also when data is nullptr

In the constructor of ArrayBufferContents, we did not create a
V8::BackingStore if an byte array was provided, i.e. byte == nullptr.
Without BackingStore, however, it was not possible to create a
V8::ArrayBuffer for this ArrayBufferContents, as V8 expected that a
BackingStore always exists. With this CL we always create a
BackingStore, even though the data is nullptr.

R=haraken@chromium.org, ulan@chromium.org

Bug: chromium:1104580
Change-Id: I4a05de503f5916a9491dbe4595f699c0e834bb10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2302694Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#791184}
parent 775f18b6
...@@ -38,9 +38,8 @@ namespace blink { ...@@ -38,9 +38,8 @@ namespace blink {
ArrayBufferContents::ArrayBufferContents(void* data, ArrayBufferContents::ArrayBufferContents(void* data,
size_t length, size_t length,
DataDeleter deleter) { DataDeleter deleter) {
if (!data) { DCHECK(data || length == 0);
return;
}
backing_store_ = backing_store_ =
v8::ArrayBuffer::NewBackingStore(data, length, deleter, nullptr); v8::ArrayBuffer::NewBackingStore(data, length, deleter, nullptr);
} }
......
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