2017-01-11 00:00:30 +01:00
|
|
|
// Copyright (c) 2017 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.
|
|
|
|
//
|
2017-07-27 01:19:27 +02:00
|
|
|
// $hash=06c1ac91f541c3bf4690b6f16f19043abf07180a$
|
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"
|
2012-04-04 00:14:28 +02:00
|
|
|
#include "libcef_dll/transfer_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);
|
|
|
|
}
|
|
|
|
|
|
|
|
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
|
2017-05-17 11:29:28 +02:00
|
|
|
const cef_string_t* path,
|
|
|
|
int persist_session_cookies,
|
2015-03-02 21:25:14 +01:00
|
|
|
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: path, callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefRefPtr<CefCookieManager> _retval = CefCookieManager::CreateManager(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefString(path), persist_session_cookies ? true : false,
|
2015-03-02 21:25:14 +01:00
|
|
|
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
|
|
|
void CEF_CALLBACK
|
|
|
|
cookie_manager_set_supported_schemes(struct _cef_cookie_manager_t* self,
|
|
|
|
cef_string_list_t schemes,
|
|
|
|
cef_completion_callback_t* callback) {
|
2012-04-04 00:14:28 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return;
|
|
|
|
// Verify param: schemes; type: string_vec_byref_const
|
|
|
|
DCHECK(schemes);
|
|
|
|
if (!schemes)
|
|
|
|
return;
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: callback
|
2012-04-04 00:14:28 +02:00
|
|
|
|
|
|
|
// Translate param: schemes; type: string_vec_byref_const
|
|
|
|
std::vector<CefString> schemesList;
|
|
|
|
transfer_string_list_contents(schemes, schemesList);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
CefCookieManagerCppToC::Get(self)->SetSupportedSchemes(
|
2017-05-17 11:29:28 +02:00
|
|
|
schemesList, CefCompletionCallbackCToCpp::Wrap(callback));
|
2012-04-04 00:14:28 +02:00
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: visitor; type: refptr_diff
|
|
|
|
DCHECK(visitor);
|
|
|
|
if (!visitor)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(url);
|
|
|
|
if (!url)
|
|
|
|
return 0;
|
|
|
|
// Verify param: visitor; type: refptr_diff
|
|
|
|
DCHECK(visitor);
|
|
|
|
if (!visitor)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: url; type: string_byref_const
|
|
|
|
DCHECK(url);
|
|
|
|
if (!url)
|
|
|
|
return 0;
|
|
|
|
// Verify param: cookie; type: struct_byref_const
|
|
|
|
DCHECK(cookie);
|
|
|
|
if (!cookie)
|
|
|
|
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;
|
|
|
|
if (cookie)
|
|
|
|
cookieObj.Set(*cookie, false);
|
|
|
|
|
|
|
|
// 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);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
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_set_storage_path(struct _cef_cookie_manager_t* self,
|
|
|
|
const cef_string_t* path,
|
|
|
|
int persist_session_cookies,
|
|
|
|
cef_completion_callback_t* callback) {
|
2012-04-03 03:34:16 +02:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
|
|
|
DCHECK(self);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
2015-03-02 21:25:14 +01:00
|
|
|
// Unverified params: path, callback
|
2012-04-03 03:34:16 +02:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefCookieManagerCppToC::Get(self)->SetStoragePath(
|
2017-05-17 11:29:28 +02:00
|
|
|
CefString(path), persist_session_cookies ? true : false,
|
2015-03-02 21:25:14 +01:00
|
|
|
CefCompletionCallbackCToCpp::Wrap(callback));
|
2013-02-13 20:53:41 +01: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);
|
|
|
|
if (!self)
|
|
|
|
return 0;
|
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()->set_supported_schemes = cookie_manager_set_supported_schemes;
|
|
|
|
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()->set_storage_path = cookie_manager_set_storage_path;
|
|
|
|
GetStruct()->flush_store = cookie_manager_flush_store;
|
|
|
|
}
|
|
|
|
|
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) {
|
2015-04-26 20:40:01 +02:00
|
|
|
NOTREACHED() << "Unexpected class type: " << type;
|
|
|
|
return NULL;
|
2012-04-03 03:34:16 +02:00
|
|
|
}
|
|
|
|
|
2016-09-01 13:24:30 +02:00
|
|
|
#if DCHECK_IS_ON()
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
base::AtomicRefCount CefCppToCRefCounted<CefCookieManagerCppToC,
|
|
|
|
CefCookieManager,
|
2017-07-27 01:19:27 +02:00
|
|
|
cef_cookie_manager_t>::DebugObjCt
|
|
|
|
ATOMIC_DECLARATION;
|
2012-04-03 03:34:16 +02:00
|
|
|
#endif
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
template <>
|
|
|
|
CefWrapperType CefCppToCRefCounted<CefCookieManagerCppToC,
|
|
|
|
CefCookieManager,
|
|
|
|
cef_cookie_manager_t>::kWrapperType =
|
|
|
|
WT_COOKIE_MANAGER;
|