chromium/third_party/blink/renderer/core/typed_arrays/dom_array_buffer.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Construction of WrapperTypeInfo may require non-trivial initialization due
// to cross-component address resolution in order to load the pointer to the
// parent interface's WrapperTypeInfo.  We ignore this issue because the issue
// happens only on component builds and the official release builds
// (statically-linked builds) are never affected by this issue.
#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) {}

}  // namespace

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 {}

}  // namespace blink