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=9eb5c140607cd940c7e55b38da4e8a030381c6d4$
|
2022-07-29 18:34:30 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/test/test_server_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/test/test_server_handler_ctocpp.h"
|
|
|
|
#include "libcef_dll/shutdown_checker.h"
|
|
|
|
|
|
|
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
CEF_EXPORT cef_test_server_t* cef_test_server_create_and_start(
|
2023-06-01 16:07:20 +02:00
|
|
|
uint16_t port,
|
2022-07-29 18:34:30 +02:00
|
|
|
int https_server,
|
2022-08-04 18:37:12 +02:00
|
|
|
cef_test_cert_type_t https_cert_type,
|
2022-07-29 18:34:30 +02:00
|
|
|
struct _cef_test_server_handler_t* handler) {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
|
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
// Verify param: handler; type: refptr_diff
|
|
|
|
DCHECK(handler);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!handler) {
|
2022-07-29 18:34:30 +02:00
|
|
|
return NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// Execute
|
2022-08-04 18:37:12 +02:00
|
|
|
CefRefPtr<CefTestServer> _retval = CefTestServer::CreateAndStart(
|
|
|
|
port, https_server ? true : false, https_cert_type,
|
|
|
|
CefTestServerHandlerCToCpp::Wrap(handler));
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefTestServerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
void CEF_CALLBACK test_server_stop(struct _cef_test_server_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
|
|
|
|
CefTestServerCppToC::Get(self)->Stop();
|
|
|
|
}
|
|
|
|
|
|
|
|
cef_string_userfree_t CEF_CALLBACK
|
|
|
|
test_server_get_origin(struct _cef_test_server_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 NULL;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-07-29 18:34:30 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefString _retval = CefTestServerCppToC::Get(self)->GetOrigin();
|
|
|
|
|
|
|
|
// Return type: string
|
|
|
|
return _retval.DetachToUserFree();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefTestServerCppToC::CefTestServerCppToC() {
|
|
|
|
GetStruct()->stop = test_server_stop;
|
|
|
|
GetStruct()->get_origin = test_server_get_origin;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefTestServerCppToC::~CefTestServerCppToC() {
|
|
|
|
shutdown_checker::AssertNotShutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
template <>
|
|
|
|
CefRefPtr<CefTestServer>
|
|
|
|
CefCppToCRefCounted<CefTestServerCppToC, CefTestServer, cef_test_server_t>::
|
|
|
|
UnwrapDerived(CefWrapperType type, cef_test_server_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<CefTestServerCppToC,
|
|
|
|
CefTestServer,
|
|
|
|
cef_test_server_t>::kWrapperType =
|
|
|
|
WT_TEST_SERVER;
|