diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:19:40 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-10 16:01:50 +0000 |
commit | 51f6c2793adab2d864b3d2b360000ef8db1d3e92 (patch) | |
tree | 835b3b4446b012c75e80177cef9fbe6972cc7dbe /chromium/gin/array_buffer.cc | |
parent | 6036726eb981b6c4b42047513b9d3f4ac865daac (diff) | |
download | qtwebengine-chromium-51f6c2793adab2d864b3d2b360000ef8db1d3e92.tar.gz |
BASELINE: Update Chromium to 71.0.3578.93
Change-Id: I6a32086c33670e1b033f8b10e6bf1fd4da1d105d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/gin/array_buffer.cc')
-rw-r--r-- | chromium/gin/array_buffer.cc | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/chromium/gin/array_buffer.cc b/chromium/gin/array_buffer.cc index f84934bfd71..a02797e94f6 100644 --- a/chromium/gin/array_buffer.cc +++ b/chromium/gin/array_buffer.cc @@ -83,6 +83,7 @@ class ArrayBuffer::Private : public base::RefCounted<ArrayBuffer::Private> { private: friend class base::RefCounted<Private>; + using DataDeleter = void (*)(void* data, size_t length, void* info); Private(v8::Isolate* isolate, v8::Local<v8::ArrayBuffer> array); ~Private(); @@ -95,9 +96,8 @@ class ArrayBuffer::Private : public base::RefCounted<ArrayBuffer::Private> { v8::Isolate* isolate_; void* buffer_; size_t length_; - void* allocation_base_; - size_t allocation_length_; - v8::ArrayBuffer::Allocator::AllocationMode allocation_mode_; + DataDeleter deleter_; + void* deleter_data_; }; scoped_refptr<ArrayBuffer::Private> ArrayBuffer::Private::From( @@ -118,18 +118,10 @@ ArrayBuffer::Private::Private(v8::Isolate* isolate, // Take ownership of the array buffer. CHECK(!array->IsExternal()); v8::ArrayBuffer::Contents contents = array->Externalize(); - // We shouldn't receive large page-allocated array buffers. - CHECK_NE(v8::ArrayBuffer::Allocator::AllocationMode::kReservation, - contents.AllocationMode()); buffer_ = contents.Data(); length_ = contents.ByteLength(); - allocation_base_ = contents.AllocationBase(); - allocation_length_ = contents.AllocationLength(); - - DCHECK(reinterpret_cast<uintptr_t>(allocation_base_) <= - reinterpret_cast<uintptr_t>(buffer_)); - DCHECK(reinterpret_cast<uintptr_t>(buffer_) + length_ <= - reinterpret_cast<uintptr_t>(allocation_base_) + allocation_length_); + deleter_ = contents.Deleter(); + deleter_data_ = contents.DeleterData(); array->SetAlignedPointerInInternalField(kWrapperInfoIndex, &g_array_buffer_wrapper_info); @@ -141,8 +133,7 @@ ArrayBuffer::Private::Private(v8::Isolate* isolate, } ArrayBuffer::Private::~Private() { - PerIsolateData::From(isolate_)->allocator()->Free(allocation_base_, - allocation_length_); + deleter_(buffer_, length_, deleter_data_); } void ArrayBuffer::Private::FirstWeakCallback( |