fix: crash when renderer process crashes while webview is reloading (#46735)

WebView uses WebContentsViewChildFrame, which doesn't have a Focus impl
and triggers a fatal NOTREACHED.
This commit is contained in:
wujinli 2025-04-25 16:10:27 +08:00 committed by GitHub
parent 37f8db15e9
commit 3e78bbde6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 0 deletions

View file

@ -4004,6 +4004,14 @@ void WebContents::ExitPictureInPicture() {
PictureInPictureWindowManager::GetInstance()->ExitPictureInPicture();
}
bool WebContents::ShouldFocusPageAfterCrash(content::WebContents* source) {
// WebView uses WebContentsViewChildFrame, which doesn't have a Focus impl
// and triggers a fatal NOTREACHED.
if (is_guest())
return false;
return true;
}
void WebContents::DevToolsSaveToFile(const std::string& url,
const std::string& content,
bool save_as,