summaryrefslogtreecommitdiff
path: root/core/libdeno
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2019-12-07 13:25:40 -0800
committerRy Dahl <ry@tinyclouds.org>2019-12-08 05:25:40 +0800
commit50b6907bc332315eeb13c05bf687b990bc8dd936 (patch)
tree93bd474d16d248c595431548420d224801b6f7f4 /core/libdeno
parent7144bbed34ee3d867c76a88398e6d73843385b34 (diff)
Replace deprecated GetContent with GetBackingStore (#3458)
Diffstat (limited to 'core/libdeno')
-rw-r--r--core/libdeno/binding.cc6
-rw-r--r--core/libdeno/buffer.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/core/libdeno/binding.cc b/core/libdeno/binding.cc
index 911c61499..830edcf5a 100644
--- a/core/libdeno/binding.cc
+++ b/core/libdeno/binding.cc
@@ -175,7 +175,7 @@ v8::Local<v8::Uint8Array> ImportBuf(DenoIsolate* d, deno_buf buf) {
if (buf.data_len > GLOBAL_IMPORT_BUF_SIZE) {
// Simple case. We allocate a new ArrayBuffer for this.
ab = v8::ArrayBuffer::New(d->isolate_, buf.data_len);
- data = ab->GetContents().Data();
+ data = ab->GetBackingStore()->Data();
} else {
// Fast case. We reuse the global ArrayBuffer.
if (d->global_import_buf_.IsEmpty()) {
@@ -183,7 +183,7 @@ v8::Local<v8::Uint8Array> ImportBuf(DenoIsolate* d, deno_buf buf) {
DCHECK_NULL(d->global_import_buf_ptr_);
ab = v8::ArrayBuffer::New(d->isolate_, GLOBAL_IMPORT_BUF_SIZE);
d->global_import_buf_.Reset(d->isolate_, ab);
- d->global_import_buf_ptr_ = ab->GetContents().Data();
+ d->global_import_buf_ptr_ = ab->GetBackingStore()->Data();
} else {
DCHECK(d->global_import_buf_ptr_);
ab = d->global_import_buf_.Get(d->isolate_);
@@ -233,7 +233,7 @@ void Send(const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args[1]->IsArrayBufferView()) {
auto view = v8::Local<v8::ArrayBufferView>::Cast(args[1]);
auto data =
- reinterpret_cast<uint8_t*>(view->Buffer()->GetContents().Data());
+ reinterpret_cast<uint8_t*>(view->Buffer()->GetBackingStore()->Data());
control = {data + view->ByteOffset(), view->ByteLength()};
}
diff --git a/core/libdeno/buffer.h b/core/libdeno/buffer.h
index 9a6e3acf7..a0e75f7be 100644
--- a/core/libdeno/buffer.h
+++ b/core/libdeno/buffer.h
@@ -103,7 +103,7 @@ class PinnedBuf {
PinnedBuf() : data_ptr_(nullptr), data_len_(0), pin_() {}
explicit PinnedBuf(v8::Local<v8::ArrayBufferView> view) {
- auto buf = view->Buffer()->GetContents().Data();
+ auto buf = view->Buffer()->GetBackingStore()->Data();
ArrayBufferAllocator::global().Ref(buf);
data_ptr_ = reinterpret_cast<uint8_t*>(buf) + view->ByteOffset();