2024-01-05 19:03:36 +01:00
|
|
|
// Copyright (c) 2024 The Chromium Embedded Framework Authors. All rights
|
2012-04-03 03:34:16 +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=7880ec31fa770eb0093a5320c8e2bca5279d03a2$
|
2017-05-17 11:29:28 +02:00
|
|
|
//
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/cookie_manager_cpptoc.h"
|
2014-02-05 21:35:45 +01:00
|
|
|
#include "libcef_dll/ctocpp/completion_callback_ctocpp.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
#include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h"
|
2015-03-02 21:25:14 +01:00
|
|
|
#include "libcef_dll/ctocpp/delete_cookies_callback_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/set_cookie_callback_ctocpp.h"
|
2022-01-27 18:10:29 +01:00
|
|
|
#include "libcef_dll/template_util.h"
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
|
|
|
cef_completion_callback_t* callback) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// Execute
|
2015-03-02 21:25:14 +01:00
|
|
|
CefRefPtr<CefCookieManager> _retval = CefCookieManager::GetGlobalManager(
|
|
|
|
CefCompletionCallbackCToCpp::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: refptr_same
|
|
|
|
return CefCookieManagerCppToC::Wrap(_retval);
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
namespace {
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
cookie_manager_visit_all_cookies(struct _cef_cookie_manager_t* self,
|
|
|
|
struct _cef_cookie_visitor_t* visitor) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: visitor; type: refptr_diff
|
|
|
|
DCHECK(visitor);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!visitor) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefCookieManagerCppToC::Get(self)->VisitAllCookies(
|
|
|
|
CefCookieVisitorCToCpp::Wrap(visitor));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
cookie_manager_visit_url_cookies(struct _cef_cookie_manager_t* self,
|
|
|
|
const cef_string_t* url,
|
|
|
|
int includeHttpOnly,
|
|
|
|
struct _cef_cookie_visitor_t* visitor) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(url);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!url) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: visitor; type: refptr_diff
|
|
|
|
DCHECK(visitor);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!visitor) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefCookieManagerCppToC::Get(self)->VisitUrlCookies(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefString(url), includeHttpOnly ? true : false,
|
2012-04-03 03:34:16 +02:00
|
|
|
CefCookieVisitorCToCpp::Wrap(visitor));
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
cookie_manager_set_cookie(struct _cef_cookie_manager_t* self,
|
|
|
|
const cef_string_t* url,
|
|
|
|
const struct _cef_cookie_t* cookie,
|
|
|
|
struct _cef_set_cookie_callback_t* callback) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(url);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!url) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
// Verify param: cookie; type: struct_byref_const
|
|
|
|
DCHECK(cookie);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!cookie) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2022-01-27 18:10:29 +01:00
|
|
|
if (!template_util::has_valid_size(cookie)) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "invalid cookie->[base.]size";
|
2022-01-27 18:10:29 +01:00
|
|
|
return 0;
|
|
|
|
}
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Translate param: cookie; type: struct_byref_const
|
|
|
|
CefCookie cookieObj;
|
2023-01-02 23:47:15 +01:00
|
|
|
if (cookie) {
|
2012-04-03 03:34:16 +02:00
|
|
|
cookieObj.Set(*cookie, false);
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefCookieManagerCppToC::Get(self)->SetCookie(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefString(url), cookieObj, CefSetCookieCallbackCToCpp::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
cookie_manager_delete_cookies(struct _cef_cookie_manager_t* self,
|
|
|
|
const cef_string_t* url,
|
|
|
|
const cef_string_t* cookie_name,
|
|
|
|
struct _cef_delete_cookies_callback_t* callback) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2012-04-03 03:34:16 +02:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: url, cookie_name, callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefCookieManagerCppToC::Get(self)->DeleteCookies(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefString(url), CefString(cookie_name),
|
2015-03-02 21:25:14 +01:00
|
|
|
CefDeleteCookiesCallbackCToCpp::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
int CEF_CALLBACK
|
|
|
|
cookie_manager_flush_store(struct _cef_cookie_manager_t* self,
|
|
|
|
cef_completion_callback_t* callback) {
|
2013-02-13 20:53:41 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
2023-01-02 23:47:15 +01:00
|
|
|
if (!self) {
|
2013-02-13 20:53:41 +01:00
|
|
|
return 0;
|
2023-01-02 23:47:15 +01:00
|
|
|
}
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
2013-02-13 20:53:41 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefCookieManagerCppToC::Get(self)->FlushStore(
|
2014-02-05 21:35:45 +01:00
|
|
|
CefCompletionCallbackCToCpp::Wrap(callback));
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
|
|
|
}
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
} // namespace
|
|
|
|
|
2012-04-03 03:34:16 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
2015-04-26 20:40:01 +02:00
|
|
|
CefCookieManagerCppToC::CefCookieManagerCppToC() {
|
|
|
|
GetStruct()->visit_all_cookies = cookie_manager_visit_all_cookies;
|
|
|
|
GetStruct()->visit_url_cookies = cookie_manager_visit_url_cookies;
|
|
|
|
GetStruct()->set_cookie = cookie_manager_set_cookie;
|
|
|
|
GetStruct()->delete_cookies = cookie_manager_delete_cookies;
|
|
|
|
GetStruct()->flush_store = cookie_manager_flush_store;
|
|
|
|
}
|
|
|
|
|
2019-01-23 16:42:12 +01:00
|
|
|
// DESTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefCookieManagerCppToC::~CefCookieManagerCppToC() {}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefRefPtr<CefCookieManager> CefCppToCRefCounted<
|
|
|
|
CefCookieManagerCppToC,
|
|
|
|
CefCookieManager,
|
|
|
|
cef_cookie_manager_t>::UnwrapDerived(CefWrapperType type,
|
|
|
|
cef_cookie_manager_t* s) {
|
2023-05-08 17:15:02 +02:00
|
|
|
DCHECK(false) << "Unexpected class type: " << type;
|
2020-01-15 14:53:19 +01:00
|
|
|
return nullptr;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefCookieManagerCppToC,
|
|
|
|
CefCookieManager,
|
|
|
|
cef_cookie_manager_t>::kWrapperType =
|
|
|
|
WT_COOKIE_MANAGER;
|