Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(797)

Unified Diff: content/browser/download/save_package.cc

Issue 1842873003: Fix how Save-Page-As responds to web requests blocked by extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/save_file_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/save_package.cc
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index 5b7d6a6ead1e1e160d6999fc193f791e2fc2b738..6e46f8266222a2942419bf2151046b2436e5540a 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -1009,7 +1009,14 @@ void SavePackage::GetSerializedHtmlWithLocalLinksForFrame(
target_frame_tree_node_id);
if (it != frame_tree_node_id_to_contained_save_items_.end()) {
for (SaveItem* save_item : it->second) {
- DCHECK(save_item->has_final_name());
+ // Skip items that failed to save.
+ if (!save_item->has_final_name()) {
+ DCHECK_EQ(SaveItem::SaveState::COMPLETE, save_item->state());
+ DCHECK(!save_item->success());
+ continue;
+ }
+
+ // Calculate the relative path for referring to the |save_item|.
base::FilePath local_path(base::FilePath::kCurrentDirectory);
if (target_tree_node->IsMainFrame()) {
local_path = local_path.Append(saved_main_directory_path_.BaseName());
« no previous file with comments | « content/browser/download/save_file_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698