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

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

Issue 10947011: Protect against touching download after observation has been stopped. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | « no previous file | 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 adf44d8a0259ec8dcf54cd5e9663f4f34980fe44..42bfb7fd01f39ee02894a297f93ac28cc6b22140 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -747,17 +747,19 @@ void SavePackage::Finish() {
file_manager_,
save_ids));
- // Hack to avoid touching download_ after user cancel.
- // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
- // with SavePackage flow.
- if (download_ && download_->IsInProgress()) {
- if (save_type_ != content::SAVE_PAGE_TYPE_AS_MHTML) {
- download_->OnAllDataSaved(all_save_items_count_,
- DownloadItem::kEmptyFileHash);
+ if (download_) {
+ // Hack to avoid touching download_ after user cancel.
+ // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
+ // with SavePackage flow.
+ if (download_->IsInProgress()) {
+ if (save_type_ != content::SAVE_PAGE_TYPE_AS_MHTML) {
+ download_->OnAllDataSaved(all_save_items_count_,
+ DownloadItem::kEmptyFileHash);
+ }
+ download_->MarkAsComplete();
}
- download_->MarkAsComplete();
+ FinalizeDownloadEntry();
}
- FinalizeDownloadEntry();
}
// Called for updating end state.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698