2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
2017-11-09 20:00:47 +01: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=23238422c7ca4a76c2959df8cc7a5d61fed29576$
|
2017-11-09 20:00:47 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/server_handler_ctocpp.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
#include "libcef_dll/cpptoc/callback_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/request_cpptoc.h"
|
|
|
|
#include "libcef_dll/cpptoc/server_cpptoc.h"
|
2019-01-23 16:42:12 +01:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnServerCreated(CefRefPtr<CefServer> server) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_server_created)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_server_created(_struct, CefServerCppToC::Wrap(server));
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnServerDestroyed(CefRefPtr<CefServer> server) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_server_destroyed)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_server_destroyed(_struct, CefServerCppToC::Wrap(server));
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnClientConnected(CefRefPtr<CefServer> server,
|
|
|
|
int connection_id) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_client_connected)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_client_connected(_struct, CefServerCppToC::Wrap(server),
|
|
|
|
connection_id);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnClientDisconnected(CefRefPtr<CefServer> server,
|
|
|
|
int connection_id) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_client_disconnected)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_client_disconnected(_struct, CefServerCppToC::Wrap(server),
|
|
|
|
connection_id);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnHttpRequest(CefRefPtr<CefServer> server,
|
|
|
|
int connection_id,
|
|
|
|
const CefString& client_address,
|
|
|
|
CefRefPtr<CefRequest> request) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_http_request)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
// Verify param: client_address; type: string_byref_const
|
|
|
|
DCHECK(!client_address.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (client_address.empty()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_http_request(_struct, CefServerCppToC::Wrap(server),
|
|
|
|
connection_id, client_address.GetStruct(),
|
|
|
|
CefRequestCppToC::Wrap(request));
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnWebSocketRequest(
|
|
|
|
CefRefPtr<CefServer> server,
|
|
|
|
int connection_id,
|
|
|
|
const CefString& client_address,
|
|
|
|
CefRefPtr<CefRequest> request,
|
|
|
|
CefRefPtr<CefCallback> callback) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_web_socket_request)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
// Verify param: client_address; type: string_byref_const
|
|
|
|
DCHECK(!client_address.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (client_address.empty()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!request.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!callback.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_web_socket_request(_struct, CefServerCppToC::Wrap(server),
|
|
|
|
connection_id, client_address.GetStruct(),
|
|
|
|
CefRequestCppToC::Wrap(request),
|
|
|
|
CefCallbackCppToC::Wrap(callback));
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnWebSocketConnected(CefRefPtr<CefServer> server,
|
|
|
|
int connection_id) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_web_socket_connected)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_web_socket_connected(_struct, CefServerCppToC::Wrap(server),
|
|
|
|
connection_id);
|
|
|
|
}
|
|
|
|
|
2018-07-12 19:55:56 +02:00
|
|
|
NO_SANITIZE("cfi-icall")
|
2017-11-09 20:00:47 +01:00
|
|
|
void CefServerHandlerCToCpp::OnWebSocketMessage(CefRefPtr<CefServer> server,
|
|
|
|
int connection_id,
|
|
|
|
const void* data,
|
|
|
|
size_t data_size) {
|
2019-01-23 16:42:12 +01:00
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
cef_server_handler_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_web_socket_message)) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!server.get()) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
// Verify param: data; type: simple_byaddr
|
|
|
|
DCHECK(data);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!data) {
|
2017-11-09 20:00:47 +01:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2017-11-09 20:00:47 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->on_web_socket_message(_struct, CefServerCppToC::Wrap(server),
|
|
|
|
connection_id, data, data_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefServerHandlerCToCpp::CefServerHandlerCToCpp() {}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefServerHandlerCToCpp::~CefServerHandlerCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
2017-11-09 20:00:47 +01:00
|
|
|
template <>
|
|
|
|
cef_server_handler_t*
|
|
|
|
CefCToCppRefCounted<CefServerHandlerCToCpp,
|
|
|
|
CefServerHandler,
|
|
|
|
cef_server_handler_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefServerHandler* c) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2017-11-09 20:00:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefServerHandlerCToCpp,
|
|
|
|
CefServerHandler,
|
|
|
|
cef_server_handler_t>::kWrapperType =
|
|
|
|
WT_SERVER_HANDLER;
|