2022-01-06 19:34:35 +01:00
|
|
|
// Copyright (c) 2022 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.
|
|
|
|
//
|
2022-01-06 19:34:35 +01:00
|
|
|
// $hash=a14c40cc86f5fd61d548d981c99c59a559619eda$
|
2017-11-09 20:00:47 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/server_handler_ctocpp.h"
|
|
|
|
#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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_server_created))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_server_destroyed))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_client_connected))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_client_disconnected))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_http_request))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
// Verify param: client_address; type: string_byref_const
|
|
|
|
DCHECK(!client_address.empty());
|
|
|
|
if (client_address.empty())
|
|
|
|
return;
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
|
|
|
if (!request.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_web_socket_request))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
// Verify param: client_address; type: string_byref_const
|
|
|
|
DCHECK(!client_address.empty());
|
|
|
|
if (client_address.empty())
|
|
|
|
return;
|
|
|
|
// Verify param: request; type: refptr_diff
|
|
|
|
DCHECK(request.get());
|
|
|
|
if (!request.get())
|
|
|
|
return;
|
|
|
|
// Verify param: callback; type: refptr_diff
|
|
|
|
DCHECK(callback.get());
|
|
|
|
if (!callback.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_web_socket_connected))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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();
|
|
|
|
if (CEF_MEMBER_MISSING(_struct, on_web_socket_message))
|
|
|
|
return;
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: server; type: refptr_diff
|
|
|
|
DCHECK(server.get());
|
|
|
|
if (!server.get())
|
|
|
|
return;
|
|
|
|
// Verify param: data; type: simple_byaddr
|
|
|
|
DCHECK(data);
|
|
|
|
if (!data)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// 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) {
|
|
|
|
NOTREACHED() << "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;
|