Popups must share the parent context to avoid crashes on parent browser destruction (issue #2162)

This commit is contained in:
Marshall Greenblatt
2017-05-04 17:53:27 -04:00
parent 4a193051a9
commit 5b9fb7e4ec
17 changed files with 448 additions and 390 deletions

View File

@@ -20,7 +20,8 @@ class CefStoragePartitionProxy;
// browser_context.h for an object relationship diagram.
class CefBrowserContextProxy : public CefBrowserContext {
public:
CefBrowserContextProxy(CefRefPtr<CefRequestContextHandler> handler,
CefBrowserContextProxy(CefRequestContextImpl* const request_context,
CefRefPtr<CefRequestContextHandler> handler,
CefBrowserContextImpl* parent);
// Must be called immediately after this object is created.
@@ -61,6 +62,7 @@ class CefBrowserContextProxy : public CefBrowserContext {
const PrefService* GetPrefs() const override;
// CefBrowserContext methods.
CefRequestContextImpl* GetCefRequestContext() const override;
const CefRequestContextSettings& GetSettings() const override;
CefRefPtr<CefRequestContextHandler> GetHandler() const override;
HostContentSettingsMap* GetHostContentSettingsMap() override;
@@ -79,6 +81,9 @@ class CefBrowserContextProxy : public CefBrowserContext {
~CefBrowserContextProxy() override;
// Guaranteed to outlive this object.
CefRequestContextImpl* const request_context_;
// Members initialized during construction are safe to access from any thread.
CefRefPtr<CefRequestContextHandler> handler_;
CefBrowserContextImpl* parent_; // Guaranteed to outlive this object.