Move cookieable scheme configuration to settings (see issue #2969)

The Chrome runtime requires that cookieable scheme information be available
at Profile initialization time because it also triggers NetworkContext creation
at the same time. To make this possible, and to avoid various race conditions
when setting state, the cookieable scheme configuration has been added as
|cookieable_schemes_list| and |cookieable_schemes_exclude_defaults| in
CefSettings and CefBrowserContextSettings. The CefCookieManager::
SetSupportedSchemes and CefBrowserProcessHandler::GetCookieableSchemes methods
are no longer required and have been removed.

This change also modifies chrome to delay OffTheRecordProfileImpl initialization
so that |ChromeBrowserContext::profile_| can be set before
ChromeContentBrowserClientCef::ConfigureNetworkContextParams calls
CefBrowserContext::FromBrowserContext to retrieve the ChromeBrowserContext
and associated cookieable scheme information. Otherwise, the
ChromeBrowserContext will not be matched and the NetworkContext will not be
configured correctly.

The CookieTest suite now passes with the Chrome runtime enabled.
This commit is contained in:
Marshall Greenblatt
2021-04-09 14:34:45 -04:00
parent c565d9b1e6
commit 76642ccafa
37 changed files with 359 additions and 473 deletions

View File

@@ -9,47 +9,15 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=f70d18a15f7c01ce5171d781577312fa7d2fb93b$
// $hash=5efe4243d536139501e58591c6f875e08001c8b7$
//
#include "libcef_dll/ctocpp/browser_process_handler_ctocpp.h"
#include "libcef_dll/cpptoc/command_line_cpptoc.h"
#include "libcef_dll/ctocpp/client_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// VIRTUAL METHODS - Body may be edited by hand.
NO_SANITIZE("cfi-icall")
void CefBrowserProcessHandlerCToCpp::GetCookieableSchemes(
std::vector<CefString>& schemes,
bool& include_defaults) {
cef_browser_process_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_cookieable_schemes))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Translate param: schemes; type: string_vec_byref
cef_string_list_t schemesList = cef_string_list_alloc();
DCHECK(schemesList);
if (schemesList)
transfer_string_list_contents(schemes, schemesList);
// Translate param: include_defaults; type: bool_byref
int include_defaultsInt = include_defaults;
// Execute
_struct->get_cookieable_schemes(_struct, schemesList, &include_defaultsInt);
// Restore param:schemes; type: string_vec_byref
if (schemesList) {
schemes.clear();
transfer_string_list_contents(schemesList, schemes);
cef_string_list_free(schemesList);
}
// Restore param:include_defaults; type: bool_byref
include_defaults = include_defaultsInt ? true : false;
}
NO_SANITIZE("cfi-icall")
void CefBrowserProcessHandlerCToCpp::OnContextInitialized() {
cef_browser_process_handler_t* _struct = GetStruct();