mirror of
https://github.com/electron/electron.git
synced 2026-02-13 00:25:15 -05:00
2720306: [api] Remove deprecated [Shared]ArrayBuffer API
https://chromium-review.googlesource.com/c/v8/v8/+/2720306
This commit is contained in:
@@ -257,7 +257,9 @@ v8::Local<v8::Value> V8ValueConverter::ToArrayBuffer(
|
||||
}
|
||||
auto context = isolate->GetCurrentContext();
|
||||
auto array_buffer = v8::ArrayBuffer::New(isolate, length);
|
||||
memcpy(array_buffer->GetContents().Data(), data, length);
|
||||
std::shared_ptr<v8::BackingStore> backing_store =
|
||||
array_buffer->GetBackingStore();
|
||||
memcpy(backing_store->Data(), data, length);
|
||||
// From this point, if something goes wrong(can't find Buffer class for
|
||||
// example) we'll simply return a Uint8Array based on the created ArrayBuffer.
|
||||
// This can happen if no preload script was specified to the renderer.
|
||||
|
||||
Reference in New Issue
Block a user