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

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

Issue 9361046: Revert 121031 - Eliminate DownloadProgressUpdated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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
Index: content/browser/download/download_manager_impl.cc
===================================================================
--- content/browser/download/download_manager_impl.cc (revision 121040)
+++ content/browser/download/download_manager_impl.cc (working copy)
@@ -450,6 +450,7 @@
<< " download = " << download->DebugString(true);
in_progress_[download_id] = download;
+ UpdateDownloadProgress(); // Reflect entry into in_progress_.
// Rename to intermediate name.
FilePath download_path;
@@ -496,6 +497,7 @@
DownloadItem* download = it->second;
if (download->IsInProgress()) {
download->UpdateProgress(bytes_so_far, bytes_per_sec, hash_state);
+ UpdateDownloadProgress(); // Reflect size updates.
delegate_->UpdateItemInPersistentStore(download);
}
}
@@ -609,6 +611,7 @@
// Remove the id from in_progress
in_progress_.erase(download->GetId());
+ UpdateDownloadProgress(); // Reflect removal from in_progress_.
delegate_->UpdateItemInPersistentStore(download);
@@ -725,6 +728,7 @@
if (download->GetDbHandle() != DownloadItem::kUninitializedHandle) {
in_progress_.erase(download->GetId());
active_downloads_.erase(download->GetId());
+ UpdateDownloadProgress(); // Reflect removal from in_progress_.
delegate_->UpdateItemInPersistentStore(download);
}
}
@@ -742,6 +746,10 @@
delegate_ = delegate;
}
+void DownloadManagerImpl::UpdateDownloadProgress() {
+ delegate_->DownloadProgressUpdated();
+}
+
int DownloadManagerImpl::RemoveDownloadItems(
const DownloadVector& pending_deletes) {
if (pending_deletes.empty())
« no previous file with comments | « content/browser/download/download_manager_impl.h ('k') | content/public/browser/download_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698