2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +02:00
|
|
|
// 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.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=e7ddd2796d7f817f1eedea93cdfdf94a8d824363$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-04-03 03:34:16 +02:00
|
|
|
|
2017-05-19 11:06:00 +02:00
|
|
|
#include "libcef_dll/cpptoc/v8context_cpptoc.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/cpptoc/browser_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/frame_cpptoc.h"
|
2013-01-03 18:24:24 +01:00
|
|
|
#include "libcef_dll/cpptoc/task_runner_cpptoc.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/cpptoc/v8exception_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/v8value_cpptoc.h"
|
|
|
|
|
|
|
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context() {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefV8Context> _retval = CefV8Context::GetCurrentContext();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefV8ContextCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context() {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefV8Context> _retval = CefV8Context::GetEnteredContext();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefV8ContextCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
CEF_EXPORT int cef_v8context_in_context() {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefV8Context::InContext();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
namespace {
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_task_runner_t* CEF_CALLBACK
|
|
|
|
v8context_get_task_runner(struct _cef_v8context_t* self) {
|
2013-01-03 18:24:24 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2013-01-03 18:24:24 +01:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
CefRefPtr<CefTaskRunner> _retval =
|
|
|
|
CefV8ContextCppToC::Get(self)->GetTaskRunner();
|
2013-01-03 18:24:24 +01:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefTaskRunnerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2012-10-29 22:46:02 +01:00
|
|
|
int CEF_CALLBACK v8context_is_valid(struct _cef_v8context_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-10-29 22:46:02 +01:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-10-29 22:46:02 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefV8ContextCppToC::Get(self)->IsValid();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
cef_browser_t* CEF_CALLBACK
|
|
|
|
v8context_get_browser(struct _cef_v8context_t* self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefBrowser> _retval = CefV8ContextCppToC::Get(self)->GetBrowser();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefBrowserCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
cef_frame_t* CEF_CALLBACK v8context_get_frame(struct _cef_v8context_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefFrame> _retval = CefV8ContextCppToC::Get(self)->GetFrame();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefFrameCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_v8value_t* CEF_CALLBACK
|
|
|
|
v8context_get_global(struct _cef_v8context_t* self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefV8Value> _retval = CefV8ContextCppToC::Get(self)->GetGlobal();
|
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefV8ValueCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK v8context_enter(struct _cef_v8context_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefV8ContextCppToC::Get(self)->Enter();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK v8context_exit(struct _cef_v8context_t* self) {
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefV8ContextCppToC::Get(self)->Exit();
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK v8context_is_same(struct _cef_v8context_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
struct _cef_v8context_t* that) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: that; type: refptr_same
|
|
|
|
DCHECK(that);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!that) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
2017-05-17 11:29:28 +02:00
|
|
|
bool _retval =
|
|
|
|
CefV8ContextCppToC::Get(self)->IsSame(CefV8ContextCppToC::Unwrap(that));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
int CEF_CALLBACK v8context_eval(struct _cef_v8context_t* self,
|
2017-05-17 11:29:28 +02:00
|
|
|
const cef_string_t* code,
|
|
|
|
const cef_string_t* script_url,
|
|
|
|
int start_line,
|
|
|
|
struct _cef_v8value_t** retval,
|
|
|
|
struct _cef_v8exception_t** exception) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: code; type: string_byref_const
|
|
|
|
DCHECK(code);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!code) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: retval; type: refptr_same_byref
|
|
|
|
DCHECK(retval);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!retval) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: exception; type: refptr_same_byref
|
|
|
|
DCHECK(exception);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!exception) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2016-10-27 18:34:19 +02:00
|
|
|
// Unverified params: script_url
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Translate param: retval; type: refptr_same_byref
|
|
|
|
CefRefPtr<CefV8Value> retvalPtr;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (retval && *retval) {
|
2012-04-03 03:34:16 +02:00
|
|
|
retvalPtr = CefV8ValueCppToC::Unwrap(*retval);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
CefV8Value* retvalOrig = retvalPtr.get();
|
|
|
|
// Translate param: exception; type: refptr_same_byref
|
|
|
|
CefRefPtr<CefV8Exception> exceptionPtr;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (exception && *exception) {
|
2012-04-03 03:34:16 +02:00
|
|
|
exceptionPtr = CefV8ExceptionCppToC::Unwrap(*exception);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
CefV8Exception* exceptionOrig = exceptionPtr.get();
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefV8ContextCppToC::Get(self)->Eval(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefString(code), CefString(script_url), start_line, retvalPtr,
|
2012-04-03 03:34:16 +02:00
|
|
|
exceptionPtr);
|
|
|
|
|
|
|
|
// Restore param: retval; type: refptr_same_byref
|
|
|
|
if (retval) {
|
|
|
|
if (retvalPtr.get()) {
|
|
|
|
if (retvalPtr.get() != retvalOrig) {
|
|
|
|
*retval = CefV8ValueCppToC::Wrap(retvalPtr);
|
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
*retval = nullptr;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// Restore param: exception; type: refptr_same_byref
|
|
|
|
if (exception) {
|
|
|
|
if (exceptionPtr.get()) {
|
|
|
|
if (exceptionPtr.get() != exceptionOrig) {
|
|
|
|
*exception = CefV8ExceptionCppToC::Wrap(exceptionPtr);
|
|
|
|
}
|
|
|
|
} else {
|
2020-01-15 14:53:19 +01:00
|
|
|
*exception = nullptr;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
} // namespace
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
CefV8ContextCppToC::CefV8ContextCppToC() {
|
|
|
|
GetStruct()->get_task_runner = v8context_get_task_runner;
|
|
|
|
GetStruct()->is_valid = v8context_is_valid;
|
|
|
|
GetStruct()->get_browser = v8context_get_browser;
|
|
|
|
GetStruct()->get_frame = v8context_get_frame;
|
|
|
|
GetStruct()->get_global = v8context_get_global;
|
|
|
|
GetStruct()->enter = v8context_enter;
|
|
|
|
GetStruct()->exit = v8context_exit;
|
|
|
|
GetStruct()->is_same = v8context_is_same;
|
|
|
|
GetStruct()->eval = v8context_eval;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefV8ContextCppToC::~CefV8ContextCppToC() {}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefV8Context>
|
|
|
|
CefCppToCRefCounted<CefV8ContextCppToC, CefV8Context, cef_v8context_t>::
|
|
|
|
UnwrapDerived(CefWrapperType type, cef_v8context_t* s) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefV8ContextCppToC,
|
|
|
|
CefV8Context,
|
|
|
|
cef_v8context_t>::kWrapperType =
|
|
|
|
WT_V8CONTEXT;
|