Add workaround for crash on popup window creation (see issue #3040)
This commit is contained in:
parent
71179da2f6
commit
2a64387259
|
@ -364,12 +364,13 @@ bool AlloyBrowserHostImpl::TryCloseBrowser() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlloyBrowserHostImpl::SetFocus(bool focus) {
|
void AlloyBrowserHostImpl::SetFocus(bool focus) {
|
||||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
// Always execute asynchronously to work around issue #3040.
|
||||||
CEF_POST_TASK(CEF_UIT,
|
CEF_POST_TASK(CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::SetFocusInternal,
|
||||||
base::BindOnce(&AlloyBrowserHostImpl::SetFocus, this, focus));
|
this, focus));
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
void AlloyBrowserHostImpl::SetFocusInternal(bool focus) {
|
||||||
|
CEF_REQUIRE_UIT();
|
||||||
if (focus)
|
if (focus)
|
||||||
OnSetFocus(FOCUS_SOURCE_SYSTEM);
|
OnSetFocus(FOCUS_SOURCE_SYSTEM);
|
||||||
else if (platform_delegate_)
|
else if (platform_delegate_)
|
||||||
|
|
|
@ -370,6 +370,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
||||||
void InitializeDevToolsRegistrationOnUIThread(
|
void InitializeDevToolsRegistrationOnUIThread(
|
||||||
CefRefPtr<CefRegistration> registration);
|
CefRefPtr<CefRegistration> registration);
|
||||||
|
|
||||||
|
void SetFocusInternal(bool focus);
|
||||||
|
|
||||||
CefWindowHandle opener_;
|
CefWindowHandle opener_;
|
||||||
const bool is_windowless_;
|
const bool is_windowless_;
|
||||||
const bool is_views_hosted_;
|
const bool is_views_hosted_;
|
||||||
|
|
Loading…
Reference in New Issue