gpui-component/crates/wef/cpp/sandbox_context.cpp
Sunli b70b229370
wef: Added a new WebView component named "Wef" based on CEF. (#877)
Wef is a Rust library for embedding WebView functionality using Chromium
Embedded Framework (CEF3) with offscreen rendering support.
2025-06-17 18:57:44 +08:00

19 lines
No EOL
422 B
C++

#include "include/cef_sandbox_mac.h"
extern "C" {
void* wef_sandbox_context_create(char* argv[], int argc) {
CefScopedSandboxContext* ctx = new CefScopedSandboxContext();
if (!ctx->Initialize(argc, argv)) {
delete ctx;
return nullptr;
}
return ctx;
}
void wef_sandbox_context_destroy(void* p) {
CefScopedSandboxContext* ctx = static_cast<CefScopedSandboxContext*>(p);
delete ctx;
}
} // extern "C"