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,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=e6881fab8b5f8b46c08f0b472abdc8508edaed52$
// $hash=719a890627d0b2ba0746415c0dd8631e387567fe$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_PROCESS_HANDLER_CTOCPP_H_
@@ -20,7 +20,6 @@
#error This file can be included DLL-side only
#endif
#include <vector>
#include "include/capi/cef_browser_process_handler_capi.h"
#include "include/cef_browser_process_handler.h"
#include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
@@ -36,8 +35,6 @@ class CefBrowserProcessHandlerCToCpp
virtual ~CefBrowserProcessHandlerCToCpp();
// CefBrowserProcessHandler methods.
void GetCookieableSchemes(std::vector<CefString>& schemes,
bool& include_defaults) override;
void OnContextInitialized() override;
void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) override;