Skip to content

Commit 50b6907

Browse files
kevinkassimory
authored andcommitted
Replace deprecated GetContent with GetBackingStore (#3458)
1 parent 7144bbe commit 50b6907

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/libdeno/binding.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ v8::Local<v8::Uint8Array> ImportBuf(DenoIsolate* d, deno_buf buf) {
175175
if (buf.data_len > GLOBAL_IMPORT_BUF_SIZE) {
176176
// Simple case. We allocate a new ArrayBuffer for this.
177177
ab = v8::ArrayBuffer::New(d->isolate_, buf.data_len);
178-
data = ab->GetContents().Data();
178+
data = ab->GetBackingStore()->Data();
179179
} else {
180180
// Fast case. We reuse the global ArrayBuffer.
181181
if (d->global_import_buf_.IsEmpty()) {
182182
// Lazily initialize it.
183183
DCHECK_NULL(d->global_import_buf_ptr_);
184184
ab = v8::ArrayBuffer::New(d->isolate_, GLOBAL_IMPORT_BUF_SIZE);
185185
d->global_import_buf_.Reset(d->isolate_, ab);
186-
d->global_import_buf_ptr_ = ab->GetContents().Data();
186+
d->global_import_buf_ptr_ = ab->GetBackingStore()->Data();
187187
} else {
188188
DCHECK(d->global_import_buf_ptr_);
189189
ab = d->global_import_buf_.Get(d->isolate_);
@@ -233,7 +233,7 @@ void Send(const v8::FunctionCallbackInfo<v8::Value>& args) {
233233
if (args[1]->IsArrayBufferView()) {
234234
auto view = v8::Local<v8::ArrayBufferView>::Cast(args[1]);
235235
auto data =
236-
reinterpret_cast<uint8_t*>(view->Buffer()->GetContents().Data());
236+
reinterpret_cast<uint8_t*>(view->Buffer()->GetBackingStore()->Data());
237237
control = {data + view->ByteOffset(), view->ByteLength()};
238238
}
239239

core/libdeno/buffer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class PinnedBuf {
103103
PinnedBuf() : data_ptr_(nullptr), data_len_(0), pin_() {}
104104

105105
explicit PinnedBuf(v8::Local<v8::ArrayBufferView> view) {
106-
auto buf = view->Buffer()->GetContents().Data();
106+
auto buf = view->Buffer()->GetBackingStore()->Data();
107107
ArrayBufferAllocator::global().Ref(buf);
108108

109109
data_ptr_ = reinterpret_cast<uint8_t*>(buf) + view->ByteOffset();

0 commit comments

Comments
 (0)