// Copyright (c) 2026 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=e1d42980b792d8b17c556b35ae1640813a3a57bf$
//

#include "libcef_dll/ctocpp/v8_backing_store_ctocpp.h"

#if CEF_API_ADDED(14600)

// STATIC METHODS - Body may be edited by hand.

NO_SANITIZE("cfi-icall")
CefRefPtr<CefV8BackingStore> CefV8BackingStore::Create(size_t byte_length) {
  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  auto *_retval = cef_v8_backing_store_create(byte_length);

  // Return type: refptr_same
  return CefV8BackingStoreCToCpp_Wrap(_retval);
}

// VIRTUAL METHODS - Body may be edited by hand.

NO_SANITIZE("cfi-icall") void *CefV8BackingStoreCToCpp::Data() {
  auto *_struct = GetStruct();
  if (!_struct->data) {
    return nullptr;
  }

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  void *_retval = _struct->data(_struct);

  // Return type: simple_byaddr
  return _retval;
}

NO_SANITIZE("cfi-icall") size_t CefV8BackingStoreCToCpp::ByteLength() {
  auto *_struct = GetStruct();
  if (!_struct->byte_length) {
    return 0;
  }

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  size_t _retval = _struct->byte_length(_struct);

  // Return type: simple
  return _retval;
}

NO_SANITIZE("cfi-icall") bool CefV8BackingStoreCToCpp::IsValid() {
  auto *_struct = GetStruct();
  if (!_struct->is_valid) {
    return false;
  }

  // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING

  // Execute
  int _retval = _struct->is_valid(_struct);

  // Return type: bool
  return _retval ? true : false;
}

// CONSTRUCTOR - Do not edit by hand.

CefV8BackingStoreCToCpp::CefV8BackingStoreCToCpp() {}

// DESTRUCTOR - Do not edit by hand.

CefV8BackingStoreCToCpp::~CefV8BackingStoreCToCpp() {}

template <>
cef_v8_backing_store_t *
CefCToCppRefCounted<CefV8BackingStoreCToCpp, CefV8BackingStore,
                    cef_v8_backing_store_t>::UnwrapDerived(CefWrapperType type,
                                                           CefV8BackingStore
                                                               *c) {
  CHECK(false) << __func__ << " called with unexpected class type " << type;
  return nullptr;
}

template <>
CefWrapperType CefCToCppRefCounted<CefV8BackingStoreCToCpp, CefV8BackingStore,
                                   cef_v8_backing_store_t>::kWrapperType =
    WT_V8_BACKING_STORE;

#endif // CEF_API_ADDED(14600)
