mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Popups must share the parent context to avoid crashes on parent browser destruction (issue #2162)
This commit is contained in:
@ -2286,16 +2286,14 @@ void CefBrowserHostImpl::WebContentsCreated(
|
||||
CefRefPtr<CefBrowserHostImpl> opener = GetBrowserForContents(source_contents);
|
||||
DCHECK(opener.get());
|
||||
|
||||
// Popups must share the same BrowserContext as the parent.
|
||||
CefBrowserContext* browser_context =
|
||||
static_cast<CefBrowserContext*>(new_contents->GetBrowserContext());
|
||||
DCHECK(browser_context);
|
||||
CefRefPtr<CefRequestContext> request_context =
|
||||
CefRequestContextImpl::CreateForBrowserContext(browser_context).get();
|
||||
DCHECK(request_context.get());
|
||||
|
||||
CefRefPtr<CefBrowserHostImpl> browser = CefBrowserHostImpl::CreateInternal(
|
||||
settings, client, new_contents, info, opener, false, request_context,
|
||||
std::move(platform_delegate));
|
||||
settings, client, new_contents, info, opener, false,
|
||||
browser_context->GetCefRequestContext(), std::move(platform_delegate));
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::DidNavigateMainFramePostCommit(
|
||||
|
Reference in New Issue
Block a user