Index: content/browser/download/download_manager.cc |
diff --git a/content/browser/download/download_manager.cc b/content/browser/download/download_manager.cc |
index e3235aea22fd6ecfb8f37603ce14f577d2ef4352..14248d82831da79154d5c7f8df88796af1f15c3d 100644 |
--- a/content/browser/download/download_manager.cc |
+++ b/content/browser/download/download_manager.cc |
@@ -25,6 +25,7 @@ |
#include "content/browser/download/download_item.h" |
#include "content/browser/download/download_manager_delegate.h" |
#include "content/browser/download/download_persistent_store_info.h" |
+#include "content/browser/download/download_stats.h" |
#include "content/browser/download/download_status_updater.h" |
#include "content/browser/renderer_host/render_process_host.h" |
#include "content/browser/renderer_host/render_view_host.h" |
@@ -326,6 +327,8 @@ void DownloadManager::RestartDownload( |
void DownloadManager::CreateDownloadItem(DownloadCreateInfo* info) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
+ download_stats::RecordHistorySize2(history_downloads_.size()); |
+ |
DownloadItem* download = new DownloadItem(this, *info, |
browser_context_->IsOffTheRecord()); |
int32 download_id = info->download_id; |
@@ -682,6 +685,7 @@ int DownloadManager::RemoveDownloads(const base::Time remove_begin) { |
} |
int DownloadManager::RemoveAllDownloads() { |
+ download_stats::RecordClearAllSize(history_downloads_.size()); |
// The null times make the date range unbounded. |
return RemoveDownloadsBetween(base::Time(), base::Time()); |
} |
@@ -817,6 +821,8 @@ void DownloadManager::OnPersistentStoreQueryComplete( |
// http://crbug.com/84508 is fixed. |
largest_db_handle_in_history_ = 0; |
+ download_stats::RecordHistorySize(entries->size()); |
+ |
for (size_t i = 0; i < entries->size(); ++i) { |
DownloadItem* download = new DownloadItem(this, entries->at(i)); |
// TODO(rdsmith): Remove after http://crbug.com/85408 resolved. |
@@ -1068,3 +1074,7 @@ void DownloadManager::SavePageDownloadFinished(DownloadItem* download) { |
Details<DownloadItem>(download)); |
} |
} |
+ |
+void DownloadManager::MarkDownloadOpened(int64 db_handle) { |
+ delegate_->MarkDownloadOpened(db_handle); |
+} |