mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add workaround for crash on Views popup window creation (see issue #3040)
This commit is contained in:
@@ -132,6 +132,14 @@ void CefBrowserViewImpl::SetPreferAccelerators(bool prefer_accelerators) {
|
||||
root_view()->set_allow_accelerators(prefer_accelerators);
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::RequestFocus() {
|
||||
CEF_REQUIRE_VALID_RETURN_VOID();
|
||||
// Always execute asynchronously to work around issue #3040.
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::BindOnce(&CefBrowserViewImpl::RequestFocusInternal,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::SetBackgroundColor(cef_color_t color) {
|
||||
CEF_REQUIRE_VALID_RETURN_VOID();
|
||||
ParentClass::SetBackgroundColor(color);
|
||||
@@ -182,7 +190,7 @@ void CefBrowserViewImpl::OnBoundsChanged() {
|
||||
|
||||
CefBrowserViewImpl::CefBrowserViewImpl(
|
||||
CefRefPtr<CefBrowserViewDelegate> delegate)
|
||||
: ParentClass(delegate) {}
|
||||
: ParentClass(delegate), weak_ptr_factory_(this) {}
|
||||
|
||||
void CefBrowserViewImpl::SetPendingBrowserCreateParams(
|
||||
CefRefPtr<CefClient> client,
|
||||
@@ -248,3 +256,7 @@ bool CefBrowserViewImpl::HandleAccelerator(
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CefBrowserViewImpl::RequestFocusInternal() {
|
||||
ParentClass::RequestFocus();
|
||||
}
|
||||
|
Reference in New Issue
Block a user