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

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

Issue 10837125: Revert 149794 - DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1228/src/
Patch Set: Created 8 years, 4 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/drag_download_file.h ('k') | content/browser/download/save_package.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/drag_download_file.cc
===================================================================
--- content/browser/download/drag_download_file.cc (revision 150095)
+++ content/browser/download/drag_download_file.cc (working copy)
@@ -196,7 +196,8 @@
void DragDownloadFile::OnDownloadUpdated(content::DownloadItem* download) {
AssertCurrentlyOnUIThread();
- if (download->IsCancelled()) {
+ if (download->IsCancelled() ||
+ (download->GetState() == DownloadItem::REMOVING)) {
RemoveObservers();
DownloadCompleted(false);
} else if (download->IsComplete()) {
@@ -206,17 +207,6 @@
// Ignore other states.
}
-// If the download completes or is cancelled, then OnDownloadUpdated() will
-// handle it and RemoveObserver() so that OnDownloadDestroyed is never called.
-// OnDownloadDestroyed is only called if OnDownloadUpdated() does not detect
-// completion or cancellation (in which cases it removes this observer).
-// TODO(benjhayden): Try to change this to NOTREACHED()?
-void DragDownloadFile::OnDownloadDestroyed(content::DownloadItem* download) {
- AssertCurrentlyOnUIThread();
- RemoveObservers();
- DownloadCompleted(false);
-}
-
void DragDownloadFile::AssertCurrentlyOnDragThread() {
// Only do the check on Windows where two threads are involved.
#if defined(OS_WIN)
« no previous file with comments | « content/browser/download/drag_download_file.h ('k') | content/browser/download/save_package.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698