Add CefCookieManager interface and CefRequestHandler::GetCookieManager for custom cookie handling (issue #542).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@534 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-03-15 22:38:02 +00:00
parent 97d6924f7e
commit ef43df264a
24 changed files with 1324 additions and 576 deletions

View File

@@ -12,8 +12,6 @@
#include "include/cef_app.h"
#include "include/capi/cef_app_capi.h"
#include "include/cef_cookie.h"
#include "include/capi/cef_cookie_capi.h"
#include "include/cef_origin_whitelist.h"
#include "include/capi/cef_origin_whitelist_capi.h"
#include "include/cef_scheme.h"
@@ -27,6 +25,7 @@
#include "include/cef_v8.h"
#include "include/capi/cef_v8_capi.h"
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include "libcef_dll/cpptoc/cookie_manager_cpptoc.h"
#include "libcef_dll/cpptoc/domdocument_cpptoc.h"
#include "libcef_dll/cpptoc/domevent_cpptoc.h"
#include "libcef_dll/cpptoc/domnode_cpptoc.h"
@@ -114,6 +113,7 @@ CEF_EXPORT void cef_shutdown() {
// Check that all wrapper objects have been destroyed
DCHECK_EQ(CefBrowserCppToC::DebugObjCt, 0);
DCHECK_EQ(CefContentFilterCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefCookieManagerCppToC::DebugObjCt, 0);
DCHECK_EQ(CefCookieVisitorCToCpp::DebugObjCt, 0);
DCHECK_EQ(CefDOMDocumentCppToC::DebugObjCt, 0);
DCHECK_EQ(CefDOMEventCppToC::DebugObjCt, 0);
@@ -185,100 +185,6 @@ CEF_EXPORT void cef_quit_message_loop() {
CefQuitMessageLoop();
}
CEF_EXPORT int cef_visit_all_cookies(struct _cef_cookie_visitor_t* visitor) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: visitor; type: refptr_diff
DCHECK(visitor);
if (!visitor)
return 0;
// Execute
bool _retval = CefVisitAllCookies(
CefCookieVisitorCToCpp::Wrap(visitor));
// Return type: bool
return _retval;
}
CEF_EXPORT int cef_visit_url_cookies(const cef_string_t* url,
int includeHttpOnly, struct _cef_cookie_visitor_t* visitor) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// 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 = CefVisitUrlCookies(
CefString(url),
includeHttpOnly?true:false,
CefCookieVisitorCToCpp::Wrap(visitor));
// Return type: bool
return _retval;
}
CEF_EXPORT int cef_set_cookie(const cef_string_t* url,
const struct _cef_cookie_t* cookie) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// 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;
// Translate param: cookie; type: struct_byref_const
CefCookie cookieObj;
if (cookie)
cookieObj.Set(*cookie, false);
// Execute
bool _retval = CefSetCookie(
CefString(url),
cookieObj);
// Return type: bool
return _retval;
}
CEF_EXPORT int cef_delete_cookies(const cef_string_t* url,
const cef_string_t* cookie_name) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: url, cookie_name
// Execute
bool _retval = CefDeleteCookies(
CefString(url),
CefString(cookie_name));
// Return type: bool
return _retval;
}
CEF_EXPORT int cef_set_cookie_path(const cef_string_t* path) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: path
// Execute
bool _retval = CefSetCookiePath(
CefString(path));
// Return type: bool
return _retval;
}
CEF_EXPORT int cef_add_cross_origin_whitelist_entry(
const cef_string_t* source_origin, const cef_string_t* target_protocol,
const cef_string_t* target_domain, int allow_target_subdomains) {