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

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

Issue 1812693002: Fix how Save-Page-As responds to web requests blocked by extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed new test (to help with merges into Beta and Stable branches). 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 5686fcfe8f48be2956f52fbb36a777f1445e182e..c16b66855053dc184a848e5f9250e491cab90301 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -1013,8 +1013,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) {
- // Calculate the local link to use for this |save_item|.
- 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