2023-01-02 23:47:15 +01:00
|
|
|
// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
|
2022-07-29 18:34:30 +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.
|
|
|
|
//
|
2023-05-08 17:15:02 +02:00
|
|
|
// $hash=fe9776e1f16f92742ad5215b0f990223f8647c59$
|
2022-07-29 18:34:30 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/ctocpp/test/test_server_connection_ctocpp.h"
|
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
#include "libcef_dll/transfer_util.h"
|
|
|
|
|
|
|
|
// VIRTUAL METHODS - Body may be edited by hand.
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefTestServerConnectionCToCpp::SendHttp200Response(
|
|
|
|
const CefString& content_type,
|
|
|
|
const void* data,
|
|
|
|
size_t data_size) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_test_server_connection_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, send_http200response)) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: content_type; type: string_byref_const
|
|
|
|
DCHECK(!content_type.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (content_type.empty()) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
// Verify param: data; type: simple_byaddr
|
|
|
|
DCHECK(data);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!data) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->send_http200response(_struct, content_type.GetStruct(), data,
|
|
|
|
data_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefTestServerConnectionCToCpp::SendHttp404Response() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_test_server_connection_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, send_http404response)) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->send_http404response(_struct);
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefTestServerConnectionCToCpp::SendHttp500Response(
|
|
|
|
const CefString& error_message) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_test_server_connection_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, send_http500response)) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: error_message; type: string_byref_const
|
|
|
|
DCHECK(!error_message.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (error_message.empty()) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->send_http500response(_struct, error_message.GetStruct());
|
|
|
|
}
|
|
|
|
|
|
|
|
NO_SANITIZE("cfi-icall")
|
|
|
|
void CefTestServerConnectionCToCpp::SendHttpResponse(
|
|
|
|
int response_code,
|
|
|
|
const CefString& content_type,
|
|
|
|
const void* data,
|
|
|
|
size_t data_size,
|
|
|
|
const HeaderMap& extra_headers) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
cef_test_server_connection_t* _struct = GetStruct();
|
2023-01-02 23:47:15 +01:00
|
|
|
if (CEF_MEMBER_MISSING(_struct, send_http_response)) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: content_type; type: string_byref_const
|
|
|
|
DCHECK(!content_type.empty());
|
2023-01-02 23:47:15 +01:00
|
|
|
if (content_type.empty()) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
// Verify param: data; type: simple_byaddr
|
|
|
|
DCHECK(data);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!data) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
// Unverified params: extra_headers
|
|
|
|
|
|
|
|
// Translate param: extra_headers; type: string_map_multi_byref_const
|
|
|
|
cef_string_multimap_t extra_headersMultimap = cef_string_multimap_alloc();
|
|
|
|
DCHECK(extra_headersMultimap);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (extra_headersMultimap) {
|
2022-07-29 18:34:30 +02:00
|
|
|
transfer_string_multimap_contents(extra_headers, extra_headersMultimap);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
_struct->send_http_response(_struct, response_code, content_type.GetStruct(),
|
|
|
|
data, data_size, extra_headersMultimap);
|
|
|
|
|
|
|
|
// Restore param:extra_headers; type: string_map_multi_byref_const
|
2023-01-02 23:47:15 +01:00
|
|
|
if (extra_headersMultimap) {
|
2022-07-29 18:34:30 +02:00
|
|
|
cef_string_multimap_free(extra_headersMultimap);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefTestServerConnectionCToCpp::CefTestServerConnectionCToCpp() {}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefTestServerConnectionCToCpp::~CefTestServerConnectionCToCpp() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
cef_test_server_connection_t* CefCToCppRefCounted<
|
|
|
|
CefTestServerConnectionCToCpp,
|
|
|
|
CefTestServerConnection,
|
|
|
|
cef_test_server_connection_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
CefTestServerConnection* c) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2022-07-29 18:34:30 +02:00
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefWrapperType CefCToCppRefCounted<CefTestServerConnectionCToCpp,
|
|
|
|
CefTestServerConnection,
|
|
|
|
cef_test_server_connection_t>::kWrapperType =
|
|
|
|
WT_TEST_SERVER_CONNECTION;
|