mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Remove methods that modify cookie storage at runtime (see issue #2622).
This change removes cookie and request handler functionality that will not supported by the NetworkService. Specifically, it is no longer possible to change cookie storage locations at runime by returning a different CefCookieManager for an already initialized CefRequestContext. After this change you will need to use a separate CefRequestContext when creating a CefBrowser if you require separate cookie storage. The following methods have been removed: - CefCookieManager::CreateManager - CefCookieManager::GetBlockingManager - CefCookieManager::SetStoragePath - CefRequestContextHandler::GetCookieManager The following methods have been renamed: - CefRequestContext::GetDefaultCookieManager to GetCookieManager. This change substantially simplifies the network implementation in CEF because it is no longer necessary to proxy objects that are normally owned by Chromium. Chromium patches that are no longer necessary will be removed as a follow-up commit. To test: Verify that `ceftests --gtest_filter=-PluginTest.*` pass with NetworkService disabled. Plugin tests will be fixed in a follow-up commit.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=229d455bfe9f7c8536f7bc03734eaf29e9e637b1$
|
||||
// $hash=a672fab541f9c28f77a06c31d89f5a9d66c78751$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/cookie_manager_cpptoc.h"
|
||||
@ -35,33 +35,6 @@ CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
||||
return CefCookieManagerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_blocking_manager() {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefCookieManager> _retval = CefCookieManager::GetBlockingManager();
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefCookieManagerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
|
||||
const cef_string_t* path,
|
||||
int persist_session_cookies,
|
||||
cef_completion_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Unverified params: path, callback
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefCookieManager> _retval = CefCookieManager::CreateManager(
|
||||
CefString(path), persist_session_cookies ? true : false,
|
||||
CefCompletionCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: refptr_same
|
||||
return CefCookieManagerCppToC::Wrap(_retval);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
@ -193,27 +166,6 @@ cookie_manager_delete_cookies(struct _cef_cookie_manager_t* self,
|
||||
return _retval;
|
||||
}
|
||||
|
||||
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) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return 0;
|
||||
// Unverified params: path, callback
|
||||
|
||||
// Execute
|
||||
bool _retval = CefCookieManagerCppToC::Get(self)->SetStoragePath(
|
||||
CefString(path), persist_session_cookies ? true : false,
|
||||
CefCompletionCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK
|
||||
cookie_manager_flush_store(struct _cef_cookie_manager_t* self,
|
||||
cef_completion_callback_t* callback) {
|
||||
@ -242,7 +194,6 @@ CefCookieManagerCppToC::CefCookieManagerCppToC() {
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=f4724d1d945c06c5113ba9e1b7f7ad8d4b735b9c$
|
||||
// $hash=29ac900a92c4ec966cc115aae96c49b545bc9db9$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/request_context_cpptoc.h"
|
||||
@ -171,9 +171,9 @@ request_context_get_cache_path(struct _cef_request_context_t* self) {
|
||||
return _retval.DetachToUserFree();
|
||||
}
|
||||
|
||||
cef_cookie_manager_t* CEF_CALLBACK request_context_get_default_cookie_manager(
|
||||
struct _cef_request_context_t* self,
|
||||
cef_completion_callback_t* callback) {
|
||||
cef_cookie_manager_t* CEF_CALLBACK
|
||||
request_context_get_cookie_manager(struct _cef_request_context_t* self,
|
||||
cef_completion_callback_t* callback) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
@ -183,7 +183,7 @@ cef_cookie_manager_t* CEF_CALLBACK request_context_get_default_cookie_manager(
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefCookieManager> _retval =
|
||||
CefRequestContextCppToC::Get(self)->GetDefaultCookieManager(
|
||||
CefRequestContextCppToC::Get(self)->GetCookieManager(
|
||||
CefCompletionCallbackCToCpp::Wrap(callback));
|
||||
|
||||
// Return type: refptr_same
|
||||
@ -535,8 +535,7 @@ CefRequestContextCppToC::CefRequestContextCppToC() {
|
||||
GetStruct()->is_global = request_context_is_global;
|
||||
GetStruct()->get_handler = request_context_get_handler;
|
||||
GetStruct()->get_cache_path = request_context_get_cache_path;
|
||||
GetStruct()->get_default_cookie_manager =
|
||||
request_context_get_default_cookie_manager;
|
||||
GetStruct()->get_cookie_manager = request_context_get_cookie_manager;
|
||||
GetStruct()->register_scheme_handler_factory =
|
||||
request_context_register_scheme_handler_factory;
|
||||
GetStruct()->clear_scheme_handler_factories =
|
||||
|
@ -9,11 +9,10 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=2decd7941020bd2b96ebfa736624d1729a82fa55$
|
||||
// $hash=b98ed34333ccd44a004c88c0ca496f7821f49e18$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/request_context_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/request_context_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h"
|
||||
|
||||
@ -39,22 +38,6 @@ void CEF_CALLBACK request_context_handler_on_request_context_initialized(
|
||||
CefRequestContextCToCpp::Wrap(request_context));
|
||||
}
|
||||
|
||||
cef_cookie_manager_t* CEF_CALLBACK request_context_handler_get_cookie_manager(
|
||||
struct _cef_request_context_handler_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return NULL;
|
||||
|
||||
// Execute
|
||||
CefRefPtr<CefCookieManager> _retval =
|
||||
CefRequestContextHandlerCppToC::Get(self)->GetCookieManager();
|
||||
|
||||
// Return type: refptr_diff
|
||||
return CefCookieManagerCToCpp::Unwrap(_retval);
|
||||
}
|
||||
|
||||
int CEF_CALLBACK request_context_handler_on_before_plugin_load(
|
||||
struct _cef_request_context_handler_t* self,
|
||||
const cef_string_t* mime_type,
|
||||
@ -99,7 +82,6 @@ int CEF_CALLBACK request_context_handler_on_before_plugin_load(
|
||||
CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC() {
|
||||
GetStruct()->on_request_context_initialized =
|
||||
request_context_handler_on_request_context_initialized;
|
||||
GetStruct()->get_cookie_manager = request_context_handler_get_cookie_manager;
|
||||
GetStruct()->on_before_plugin_load =
|
||||
request_context_handler_on_before_plugin_load;
|
||||
}
|
||||
|
Reference in New Issue
Block a user