CefRequestContext::CreateContext always returns null

Issue #3338 wontfix
Andrew Warnick created an issue

CefRequestContext::CreateContext always returns null (on the 32-bit Windows build). This issue started with the Chrome 101 build and still exists in the Chrome 102 build.

CefRequestContextSettings ctxSetts; memset(&ctxSetts, 0, sizeof(ctxSetts)); ctxSetts.size = sizeof(ctxSetts);
CefString(&ctxSetts.cache_path) = "C:\\MyCefClient_Cache";
auto _pRequestContext = CefRequestContext::CreateContext(ctxSetts, _pClientHandler);
assert(_pRequestContext);

Comments (6)

  1. Alex Maitland

    Testing with 101.0.18+g367b4a0+chromium-101.0.4951.67 using a 32bit build on Windows and creating a new CefRequestContext is working as expected.

    Did you check the log file?

  2. Andrew Warnick reporter

    There is never anything about it in the debug log file.

    New discovery: To reproduce in CefClient, you have to use:

    --request-context-per-browser "--cache-path=C:\Temp\CefCache" --request-context-shared-cache

    Using shared cache is what breaks it, which makes sense because our cache location is always the same. I could not verify that it’s returning null, but I did verify that cookies are being shared between browsers.

  3. Marshall Greenblatt

    Using shared cache is what breaks it, which makes sense because our cache location is always the same. I could not verify that it’s returning null

    Breaks what exactly? This issue is about CreateContext returning null, but you say that you didn’t verify that.

    I suggest you run with a Debug build of libcef and see if any debug assertions are triggered in your usage.

  4. Andrew Warnick reporter

    The issue was caused by setting size of the CefRequestContextSettings “structure”. That used to work (or was tolerated).

  5. Marshall Greenblatt

    sizeof(CefRequestContextSettings) != sizeof(cef_request_context_settings_t). The CefRequestContextSettings object already sets the size member correctly, so you shouldn’t do that in your code.

  6. Log in to comment