Skip to content
Snippets Groups Projects
Commit b178b44e authored by Shu Yang's avatar Shu Yang Committed by Chromium LUCI CQ
Browse files

[M131] Fix a crash on pdf download complete

The PdfPage may become a FrozenNativePage while downloading.
Need to check before cast to PdfPage.

(cherry picked from commit a859c025)

Low-Coverage-Reason: TRIVIAL_CHANGE
Bug: 377305897
Change-Id: I4eefe7de95e344a07ede7c94babe3352d626f229
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5985554


Commit-Queue: Shu Yang <shuyng@google.com>
Reviewed-by: default avatarMin Qin <qinmin@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1377765}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5989896
Cr-Commit-Position: refs/branch-heads/6778@{#1726}
Cr-Branched-From: b21671ca-refs/heads/main@{#1368529}
parent dd149895
No related branches found
No related tags found
No related merge requests found
......@@ -58,11 +58,14 @@ public class DownloadController {
if (nativePage == null || !nativePage.isPdf()) {
return;
}
assert nativePage instanceof PdfPage;
((PdfPage) nativePage)
.onDownloadComplete(
downloadInfo.getFileName(), downloadInfo.getFilePath(), isDownloadSafe);
tab.updateTitle();
// The PdfPage may become a FrozenNativePage while downloading.
// Need to check before cast to PdfPage.
if (nativePage instanceof PdfPage) {
((PdfPage) nativePage)
.onDownloadComplete(
downloadInfo.getFileName(), downloadInfo.getFilePath(), isDownloadSafe);
tab.updateTitle();
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment