Ignore load of excluded PDF renderer frames

Starting with M125 we get WebContentsObserver callbacks for speculative
PDF renderer frames. These callbacks should be ignored.
This commit is contained in:
Marshall Greenblatt
2024-04-24 15:38:49 -04:00
parent b67cbc47e3
commit 65234a6830
5 changed files with 47 additions and 6 deletions

View File

@@ -551,6 +551,31 @@ CefRefPtr<CefFrameHostImpl> CefBrowserInfoManager::GetFrameHost(
return frame;
}
// static
bool CefBrowserInfoManager::IsExcludedFrameHost(content::RenderFrameHost* rfh) {
CEF_REQUIRE_UIT();
DCHECK(rfh);
const bool is_pdf_process = rfh->GetProcess()->IsPdf();
if (is_pdf_process) {
return true;
}
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
const bool is_browser_process_guest =
extensions::IsBrowserPluginGuest(web_contents);
if (is_browser_process_guest) {
return true;
}
const bool is_print_preview_dialog =
extensions::IsPrintPreviewDialog(web_contents);
if (is_print_preview_dialog) {
return true;
}
return false;
}
CefBrowserInfoManager::BrowserInfoList
CefBrowserInfoManager::GetBrowserInfoList() {
base::AutoLock lock_scope(browser_info_lock_);