2720306: [api] Remove deprecated [Shared]ArrayBuffer API

2720306
This commit is contained in:
John Kleinschmidt 2021-03-16 15:39:40 -04:00
parent ec893f8322
commit d0989802bd

View file

@ -257,7 +257,9 @@ v8::Local<v8::Value> V8ValueConverter::ToArrayBuffer(
} }
auto context = isolate->GetCurrentContext(); auto context = isolate->GetCurrentContext();
auto array_buffer = v8::ArrayBuffer::New(isolate, length); 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 // 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. // example) we'll simply return a Uint8Array based on the created ArrayBuffer.
// This can happen if no preload script was specified to the renderer. // This can happen if no preload script was specified to the renderer.