chrome: cefclient: Add support for --request-context-per-browser

Wait for the OnRequestContextInitialized callback before using a
non-global CefRequestContext.

Use default handling of --load-extension for Chrome runtime (fixes #3529).
This commit is contained in:
Marshall Greenblatt
2024-02-08 16:29:17 -05:00
parent 70471059cf
commit a79981bf7f
7 changed files with 98 additions and 48 deletions

View File

@@ -94,8 +94,8 @@ class RootWindowManager : public RootWindow::Delegate {
void NotifyExtensionsChanged();
// RootWindow::Delegate methods.
CefRefPtr<CefRequestContext> GetRequestContext(
RootWindow* root_window) override;
CefRefPtr<CefRequestContext> GetRequestContext() override;
void GetRequestContext(RequestContextCallback callback) override;
scoped_refptr<ImageCache> GetImageCache() override;
void OnTest(RootWindow* root_window, int test_id) override;
void OnExit(RootWindow* root_window) override;
@@ -109,6 +109,10 @@ class RootWindowManager : public RootWindow::Delegate {
base::OnceClosure close_callback,
bool with_osr) override;
// |callback| may be nullptr. Must be called on the main thread.
CefRefPtr<CefRequestContext> CreateRequestContext(
RequestContextCallback callback);
void CleanupOnUIThread();
const bool terminate_when_all_windows_closed_;