…questHandler
CanSendCookie/CanSaveCookie were moved off CefRequestHandler into
CefCookieAccessFilter with the NetworkService migration (CEF based on
Chromium 75, CEF issue #2622), reachable only through
CefRequestHandler::GetResourceRequestHandler() ->
CefResourceRequestHandler::GetCookieAccessFilter(). cefpython (previously
on CEF 66) never implemented GetResourceRequestHandler, so after the
upgrade to CEF 123 the cookie filter was never installed and
CanSendCookie/CanSaveCookie never fired.
- Add ResourceRequestHandler (CefResourceRequestHandler) whose
GetCookieAccessFilter() returns a CookieAccessFilter, and implement
RequestHandler::GetResourceRequestHandler() to return it.
- Add #pragma once to cookie_access_filter.h, now included from two
places (request_handler.h and resource_request_handler.h).
Guard a latent NULL dereference the wiring exposes: these callbacks run
on the IO thread where CefFrame::GetBrowser() can return NULL (observed
for cross-origin subresource requests; CEF also documents browser/frame
as optional for service-worker / CefURLRequest origins). GetPyFrame()
previously did frame.GetBrowser().GetIdentifier() unconditionally and
crashed. Guard it in GetPyFrame() and skip-with-log in the cookie filter
when no browser is resolvable, allowing the cookie by default.
Fix #676
CEF 123 moved the cookie callbacks off CefRequestHandler into CefCookieAccessFilter, reachable only through
CefRequestHandler::GetResourceRequestHandler() ->
CefResourceRequestHandler::GetCookieAccessFilter(). cefpython never implemented GetResourceRequestHandler, so the cookie filter was never installed and CanSendCookie/CanSaveCookie never fired.
Guard a latent NULL dereference the wiring exposes: these callbacks run on the IO thread where CefFrame::GetBrowser() can return NULL (observed for cross-origin subresource requests; CEF also documents browser/frame as optional for service-worker / CefURLRequest origins). GetPyFrame() previously did frame.GetBrowser().GetIdentifier() unconditionally and crashed. Guard it in GetPyFrame() and skip-with-log in the cookie filter when no browser is resolvable, allowing the cookie by default.