mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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:
@@ -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,
|
||||
|
||||
@@ -709,6 +709,7 @@ class WebContents final : public ExclusiveAccessContext,
|
||||
content::PictureInPictureResult EnterPictureInPicture(
|
||||
content::WebContents* web_contents) override;
|
||||
void ExitPictureInPicture() override;
|
||||
bool ShouldFocusPageAfterCrash(content::WebContents* source) override;
|
||||
|
||||
// InspectableWebContentsDelegate:
|
||||
void DevToolsSaveToFile(const std::string& url,
|
||||
|
||||
Reference in New Issue
Block a user