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

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

Issue 8381009: Const-ify DownloadStatusUpdaterDelegate methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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/download_manager.h ('k') | content/browser/download/download_status_updater.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_manager.cc
diff --git a/content/browser/download/download_manager.cc b/content/browser/download/download_manager.cc
index 7797935e7e4e0f5ba5679c69e8e69860bb23292c..c384f7eb840d8a7a2cd9c43e434b85f675523acb 100644
--- a/content/browser/download/download_manager.cc
+++ b/content/browser/download/download_manager.cc
@@ -737,8 +737,8 @@ void DownloadManager::RemoveObserver(Observer* observer) {
observers_.RemoveObserver(observer);
}
-bool DownloadManager::IsDownloadProgressKnown() {
- for (DownloadMap::iterator i = in_progress_.begin();
+bool DownloadManager::IsDownloadProgressKnown() const {
+ for (DownloadMap::const_iterator i = in_progress_.begin();
i != in_progress_.end(); ++i) {
if (i->second->total_bytes() <= 0)
return false;
@@ -747,24 +747,24 @@ bool DownloadManager::IsDownloadProgressKnown() {
return true;
}
-int64 DownloadManager::GetInProgressDownloadCount() {
+int64 DownloadManager::GetInProgressDownloadCount() const {
return in_progress_.size();
}
-int64 DownloadManager::GetReceivedDownloadBytes() {
+int64 DownloadManager::GetReceivedDownloadBytes() const {
DCHECK(IsDownloadProgressKnown());
int64 received_bytes = 0;
- for (DownloadMap::iterator i = in_progress_.begin();
+ for (DownloadMap::const_iterator i = in_progress_.begin();
i != in_progress_.end(); ++i) {
received_bytes += i->second->received_bytes();
}
return received_bytes;
}
-int64 DownloadManager::GetTotalDownloadBytes() {
+int64 DownloadManager::GetTotalDownloadBytes() const {
DCHECK(IsDownloadProgressKnown());
int64 total_bytes = 0;
- for (DownloadMap::iterator i = in_progress_.begin();
+ for (DownloadMap::const_iterator i = in_progress_.begin();
i != in_progress_.end(); ++i) {
total_bytes += i->second->total_bytes();
}
« no previous file with comments | « content/browser/download/download_manager.h ('k') | content/browser/download/download_status_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698