2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 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.
|
|
|
|
//
|
2024-01-05 19:03:36 +01:00
|
|
|
// $hash=1a59ed8921726601a5a429dc76db34300fd5bb9d$
|
2022-07-29 18:34:30 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/test/test_server_connection_cpptoc.h"
|
2024-04-30 17:45:07 +02:00
|
|
|
|
2022-07-29 18:34:30 +02:00
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
#include "libcef_dll/transfer_util.h"
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
void CEF_CALLBACK test_server_connection_send_http200response(
|
|
|
|
struct _cef_test_server_connection_t* self,
|
|
|
|
const cef_string_t* content_type,
|
|
|
|
const void* data,
|
|
|
|
size_t data_size) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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: content_type; type: string_byref_const
|
|
|
|
DCHECK(content_type);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!content_type) {
|
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
|
|
|
|
CefTestServerConnectionCppToC::Get(self)->SendHttp200Response(
|
|
|
|
CefString(content_type), data, data_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK test_server_connection_send_http404response(
|
|
|
|
struct _cef_test_server_connection_t* self) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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
|
|
|
|
CefTestServerConnectionCppToC::Get(self)->SendHttp404Response();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK test_server_connection_send_http500response(
|
|
|
|
struct _cef_test_server_connection_t* self,
|
|
|
|
const cef_string_t* error_message) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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: error_message; type: string_byref_const
|
|
|
|
DCHECK(error_message);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!error_message) {
|
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
|
|
|
|
CefTestServerConnectionCppToC::Get(self)->SendHttp500Response(
|
|
|
|
CefString(error_message));
|
|
|
|
}
|
|
|
|
|
|
|
|
void CEF_CALLBACK test_server_connection_send_http_response(
|
|
|
|
struct _cef_test_server_connection_t* self,
|
|
|
|
int response_code,
|
|
|
|
const cef_string_t* content_type,
|
|
|
|
const void* data,
|
|
|
|
size_t data_size,
|
|
|
|
cef_string_multimap_t extra_headers) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
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: content_type; type: string_byref_const
|
|
|
|
DCHECK(content_type);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!content_type) {
|
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
|
|
|
|
std::multimap<CefString, CefString> extra_headersMultimap;
|
|
|
|
transfer_string_multimap_contents(extra_headers, extra_headersMultimap);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefTestServerConnectionCppToC::Get(self)->SendHttpResponse(
|
|
|
|
response_code, CefString(content_type), data, data_size,
|
|
|
|
extra_headersMultimap);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefTestServerConnectionCppToC::CefTestServerConnectionCppToC() {
|
|
|
|
GetStruct()->send_http200response =
|
|
|
|
test_server_connection_send_http200response;
|
|
|
|
GetStruct()->send_http404response =
|
|
|
|
test_server_connection_send_http404response;
|
|
|
|
GetStruct()->send_http500response =
|
|
|
|
test_server_connection_send_http500response;
|
|
|
|
GetStruct()->send_http_response = test_server_connection_send_http_response;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefTestServerConnectionCppToC::~CefTestServerConnectionCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefRefPtr<CefTestServerConnection> CefCppToCRefCounted<
|
|
|
|
CefTestServerConnectionCppToC,
|
|
|
|
CefTestServerConnection,
|
|
|
|
cef_test_server_connection_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_test_server_connection_t*
|
|
|
|
s) {
|
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 CefCppToCRefCounted<CefTestServerConnectionCppToC,
|
|
|
|
CefTestServerConnection,
|
|
|
|
cef_test_server_connection_t>::kWrapperType =
|
|
|
|
WT_TEST_SERVER_CONNECTION;
|