chrome: Enforce matching context for new user and incognito profiles

Selecting a new user or incognito profile via Chrome UI may result in
the creation of a new Profile object. If that occurs, we should find
or create a matching CefBrowserContext and CefRequestContext instead
of reusing an existing mismatched context (e.g. using the original
context for an incognito window would be a mismatch). If a new
CefRequestContext will be created the client can now implement
CefBrowserProcessHandler::GetDefaultRequestContextHandler() to
provide the handler for that context.

To test with a new user profile:
1. Click "Profile" icon, select "Add". Now you have 2+ profiles.
2. Click "Profile" icon, select the other user name to create a new
   window using the other user profile.
3. The new window should launch successfully.

To test with a new incognito profile:
1. Select "New Incognito window" from the 3-dot menu.
2. The new window should launch successfully.

To test DevTools window creation for the new profile:
1. Right-click in the new window, select Inspect.
2. The DevTools window should launch successfully.
This commit is contained in:
Marshall Greenblatt
2024-02-08 13:41:18 -05:00
parent a79981bf7f
commit cc3d77eec5
14 changed files with 244 additions and 75 deletions

View File

@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "60ecc3c751154b2b2b41e5d3ac0ccbeba588918d"
#define CEF_API_HASH_UNIVERSAL "afb63c581ad6ef9b3d3ebed472cc66f75ce4647f"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "7819cee8508a9b048ccfa80acea7351a5b549c45"
#define CEF_API_HASH_PLATFORM "504dbb53deeebd11a16ea01533c5d9ecfa6be555"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "f2bb2e5a9d14dcad463fd3fc8ed4af16b6fe6196"
#define CEF_API_HASH_PLATFORM "dc3cf1d007fec844ab287dac384c8b00366d46fc"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "bcf76490ddea85c12ea8feeee9190ffe24dedcc6"
#define CEF_API_HASH_PLATFORM "2b47d389c64db81913818b708b78868a22e65b66"
#endif
#ifdef __cplusplus