#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include <algorithm>
#include "base/containers/buffer_iterator.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/platform/bindings/dom_data_store.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"
namespace blink {
#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
const WrapperTypeInfo DOMArrayBuffer::wrapper_type_info_body_{ … };
const WrapperTypeInfo& DOMArrayBuffer::wrapper_type_info_ = …;
#if defined(COMPONENT_BUILD) && defined(WIN32) && defined(__clang__)
#pragma clang diagnostic pop
#endif
namespace {
template <typename Function>
void ForArrayBuffersInAllWorlds(v8::Isolate* isolate,
const DOMArrayBuffer* object,
Function f) { … }
}
bool DOMArrayBuffer::IsDetachable(v8::Isolate* isolate) { … }
void DOMArrayBuffer::SetDetachKey(v8::Isolate* isolate,
const StringView& detach_key) { … }
bool DOMArrayBuffer::Transfer(v8::Isolate* isolate,
ArrayBufferContents& result,
ExceptionState& exception_state) { … }
bool DOMArrayBuffer::Transfer(v8::Isolate* isolate,
v8::Local<v8::Value> detach_key,
ArrayBufferContents& result,
ExceptionState& exception_state) { … }
bool DOMArrayBuffer::ShareNonSharedForInternalUse(ArrayBufferContents& result) { … }
v8::Maybe<bool> DOMArrayBuffer::TransferDetachable(
v8::Isolate* isolate,
v8::Local<v8::Value> detach_key,
ArrayBufferContents& result) { … }
DOMArrayBuffer* DOMArrayBuffer::Create(
scoped_refptr<SharedBuffer> shared_buffer) { … }
DOMArrayBuffer* DOMArrayBuffer::Create(
const Vector<base::span<const char>>& data) { … }
DOMArrayBuffer* DOMArrayBuffer::CreateOrNull(size_t num_elements,
size_t element_byte_size) { … }
DOMArrayBuffer* DOMArrayBuffer::CreateOrNull(base::span<const uint8_t> source) { … }
DOMArrayBuffer* DOMArrayBuffer::CreateUninitializedOrNull(
size_t num_elements,
size_t element_byte_size) { … }
v8::Local<v8::Value> DOMArrayBuffer::Wrap(ScriptState* script_state) { … }
bool DOMArrayBuffer::IsDetached() const { … }
v8::Local<v8::Object> DOMArrayBuffer::AssociateWithWrapper(
v8::Isolate* isolate,
const WrapperTypeInfo* wrapper_type_info,
v8::Local<v8::Object> wrapper) { … }
DOMArrayBuffer* DOMArrayBuffer::Slice(size_t begin, size_t end) const { … }
void DOMArrayBuffer::Trace(Visitor* visitor) const { … }
}