Support unsigned bundles file from network
After this CL, navigation to primary URL of web bundle from network works.
But navigation inside web bundle and history navigation doesn't work yet.
Bug: 1018640
Change-Id: I1c25dfa7ff52de99da07f094cca2fd7d0de1e500
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1883468
Commit-Queue: Tsuyoshi Horo <[email protected]>
Reviewed-by: Kunihiko Sakamoto <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Cr-Commit-Position: refs/heads/master@{#715011}
diff --git a/content/shell/browser/shell_download_manager_delegate.cc b/content/shell/browser/shell_download_manager_delegate.cc
index 9c8ff8bb..1c0ef54a 100644
--- a/content/shell/browser/shell_download_manager_delegate.cc
+++ b/content/shell/browser/shell_download_manager_delegate.cc
@@ -165,10 +165,12 @@
OPENFILENAME save_as;
ZeroMemory(&save_as, sizeof(save_as));
save_as.lStructSize = sizeof(OPENFILENAME);
- save_as.hwndOwner = DownloadItemUtils::GetWebContents(item)
- ->GetNativeView()
- ->GetHost()
- ->GetAcceleratedWidget();
+ WebContents* web_contents = DownloadItemUtils::GetWebContents(item);
+ // |web_contents| could be null if the tab was quickly closed.
+ if (!web_contents)
+ return;
+ save_as.hwndOwner =
+ web_contents->GetNativeView()->GetHost()->GetAcceleratedWidget();
save_as.lpstrFile = file_name;
save_as.nMaxFile = base::size(file_name);