mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -2579,8 +2579,7 @@ TEST(SchemeHandlerTest, AcceptLanguage) {
|
||||
// Entry point for registering custom schemes.
|
||||
// Called from client_app_delegates.cc.
|
||||
void RegisterSchemeHandlerCustomSchemes(
|
||||
CefRawPtr<CefSchemeRegistrar> registrar,
|
||||
std::vector<CefString>& cookiable_schemes) {
|
||||
CefRawPtr<CefSchemeRegistrar> registrar) {
|
||||
// Registering the custom standard schemes as secure because requests from
|
||||
// non-secure origins to the loopback address will be blocked by
|
||||
// https://chromestatus.com/feature/5436853517811712.
|
||||
@@ -2589,15 +2588,22 @@ void RegisterSchemeHandlerCustomSchemes(
|
||||
registrar->AddCustomScheme("customstd", CEF_SCHEME_OPTION_STANDARD |
|
||||
CEF_SCHEME_OPTION_SECURE |
|
||||
CEF_SCHEME_OPTION_CORS_ENABLED);
|
||||
cookiable_schemes.push_back("customstd");
|
||||
// Also used in cors_unittest.cc.
|
||||
registrar->AddCustomScheme(
|
||||
"customstdfetch", CEF_SCHEME_OPTION_STANDARD | CEF_SCHEME_OPTION_SECURE |
|
||||
CEF_SCHEME_OPTION_CORS_ENABLED |
|
||||
CEF_SCHEME_OPTION_FETCH_ENABLED);
|
||||
cookiable_schemes.push_back("customstdfetch");
|
||||
// Add a custom non-standard scheme.
|
||||
registrar->AddCustomScheme("customnonstd", CEF_SCHEME_OPTION_NONE);
|
||||
registrar->AddCustomScheme("customnonstdfetch",
|
||||
CEF_SCHEME_OPTION_FETCH_ENABLED);
|
||||
}
|
||||
|
||||
// Entry point for registering cookieable schemes.
|
||||
// Called from client_app_delegates.cc.
|
||||
void RegisterSchemeHandlerCookieableSchemes(
|
||||
std::vector<std::string>& cookieable_schemes) {
|
||||
cookieable_schemes.push_back("customstd");
|
||||
// Also used in cors_unittest.cc.
|
||||
cookieable_schemes.push_back("customstdfetch");
|
||||
}
|
||||
|
Reference in New Issue
Block a user