mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
CEF3: Add CefCookieManager::SetSupportedSchemes method which supports cookie storage for non-http(s) schemes (issue #567).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@577 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "libcef_dll/cpptoc/cookie_manager_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/cookie_visitor_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
|
||||
// GLOBAL FUNCTIONS - Body may be edited by hand.
|
||||
@@ -43,6 +44,27 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK cookie_manager_set_supported_schemes(
|
||||
struct _cef_cookie_manager_t* self, cef_string_list_t schemes) {
|
||||
// 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;
|
||||
|
||||
// Translate param: schemes; type: string_vec_byref_const
|
||||
std::vector<CefString> schemesList;
|
||||
transfer_string_list_contents(schemes, schemesList);
|
||||
|
||||
// Execute
|
||||
CefCookieManagerCppToC::Get(self)->SetSupportedSchemes(
|
||||
schemesList);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK cookie_manager_visit_all_cookies(
|
||||
struct _cef_cookie_manager_t* self,
|
||||
struct _cef_cookie_visitor_t* visitor) {
|
||||
@@ -163,6 +185,7 @@ int CEF_CALLBACK cookie_manager_set_storage_path(
|
||||
CefCookieManagerCppToC::CefCookieManagerCppToC(CefCookieManager* cls)
|
||||
: CefCppToC<CefCookieManagerCppToC, CefCookieManager, cef_cookie_manager_t>(
|
||||
cls) {
|
||||
struct_.struct_.set_supported_schemes = cookie_manager_set_supported_schemes;
|
||||
struct_.struct_.visit_all_cookies = cookie_manager_visit_all_cookies;
|
||||
struct_.struct_.visit_url_cookies = cookie_manager_visit_url_cookies;
|
||||
struct_.struct_.set_cookie = cookie_manager_set_cookie;
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
|
||||
#include "libcef_dll/transfer_util.h"
|
||||
|
||||
|
||||
// STATIC METHODS - Body may be edited by hand.
|
||||
@@ -43,6 +44,28 @@ CefRefPtr<CefCookieManager> CefCookieManager::CreateManager(
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
|
||||
void CefCookieManagerCToCpp::SetSupportedSchemes(
|
||||
const std::vector<CefString>& schemes) {
|
||||
if (CEF_MEMBER_MISSING(struct_, set_supported_schemes))
|
||||
return;
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Translate param: schemes; type: string_vec_byref_const
|
||||
cef_string_list_t schemesList = cef_string_list_alloc();
|
||||
DCHECK(schemesList);
|
||||
if (schemesList)
|
||||
transfer_string_list_contents(schemes, schemesList);
|
||||
|
||||
// Execute
|
||||
struct_->set_supported_schemes(struct_,
|
||||
schemesList);
|
||||
|
||||
// Restore param:schemes; type: string_vec_byref_const
|
||||
if (schemesList)
|
||||
cef_string_list_free(schemesList);
|
||||
}
|
||||
|
||||
bool CefCookieManagerCToCpp::VisitAllCookies(
|
||||
CefRefPtr<CefCookieVisitor> visitor) {
|
||||
if (CEF_MEMBER_MISSING(struct_, visit_all_cookies))
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
|
||||
#else // USING_CEF_SHARED
|
||||
|
||||
#include <vector>
|
||||
#include "include/cef_cookie.h"
|
||||
#include "include/capi/cef_cookie_capi.h"
|
||||
#include "libcef_dll/ctocpp/ctocpp.h"
|
||||
@@ -34,6 +35,8 @@ class CefCookieManagerCToCpp
|
||||
virtual ~CefCookieManagerCToCpp() {}
|
||||
|
||||
// CefCookieManager methods
|
||||
virtual void SetSupportedSchemes(
|
||||
const std::vector<CefString>& schemes) OVERRIDE;
|
||||
virtual bool VisitAllCookies(CefRefPtr<CefCookieVisitor> visitor) OVERRIDE;
|
||||
virtual bool VisitUrlCookies(const CefString& url, bool includeHttpOnly,
|
||||
CefRefPtr<CefCookieVisitor> visitor) OVERRIDE;
|
||||
|
Reference in New Issue
Block a user