Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cherry-pick 30261f9de11e from chromium #26203

Merged
merged 3 commits into from
Oct 28, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions patches/chromium/.patches
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,4 @@ avoid_use-after-free.patch
don_t_create_providers_if_context_is_lost.patch
fix_use_electron_generated_resources.patch
chore_expose_v8_initialization_isolate_callbacks.patch
cherry-pick-30261f9de11e.patch
29 changes: 29 additions & 0 deletions patches/chromium/cherry-pick-30261f9de11e.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Lei Zhang <thestig@chromium.org>
Date: Thu, 1 Oct 2020 19:18:54 +0000
Subject: Check RF is alive In PrintRenderFrameHelper::PreviewPageRendered().

Do not take an accessibility snapshot if the RenderFrame is gone.

Bug: 1133983
Change-Id: I612cc72936a1dcedc5180c24eae067e47237b09b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2442375
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812851}

diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index c0107f561f444d537735d4725c6dbecbcaf45226..1f7b7294aa5afb7f967ec260ab9f62d8b27d6827 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -2463,6 +2463,10 @@ bool PrintRenderFrameHelper::PreviewPageRendered(
"page_number", page_number);

#if BUILDFLAG(ENABLE_TAGGED_PDF)
+ // Make sure the RenderFrame is alive before taking the snapshot.
+ if (render_frame_gone_)
+ snapshotter_.reset();
+
// For tagged PDF exporting, send a snapshot of the accessibility tree
// along with page 0. The accessibility tree contains the content for
// all of the pages of the main frame.