diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/download/download_item.cc | 24 | ||||
-rw-r--r-- | content/browser/download/download_item.h | 8 |
2 files changed, 0 insertions, 32 deletions
diff --git a/content/browser/download/download_item.cc b/content/browser/download/download_item.cc index 25e7ead..b993a6d 100644 --- a/content/browser/download/download_item.cc +++ b/content/browser/download/download_item.cc @@ -15,7 +15,6 @@ #include "base/logging.h" #include "base/metrics/histogram.h" #include "base/stringprintf.h" -#include "base/timer.h" #include "base/utf_string_conversions.h" #include "content/browser/download/download_create_info.h" #include "content/browser/download/download_file.h" @@ -52,9 +51,6 @@ using content::BrowserThread; namespace { -// Update frequency (milliseconds). -const int kUpdateTimeMs = 1000; - static void DeleteDownloadedFile(const FilePath& path) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); @@ -334,22 +330,6 @@ void DownloadItem::UpdateSize(int64 bytes_so_far) { total_bytes_ = 0; } -void DownloadItem::StartProgressTimer() { - // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. - CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - - update_timer_.Start(FROM_HERE, - base::TimeDelta::FromMilliseconds(kUpdateTimeMs), this, - &DownloadItem::UpdateObservers); -} - -void DownloadItem::StopProgressTimer() { - // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. - CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - - update_timer_.Stop(); -} - // Updates from the download thread may have been posted while this download // was being cancelled in the UI thread, so we'll accept them unless we're // complete. @@ -384,7 +364,6 @@ void DownloadItem::Cancel(bool user_cancel) { download_stats::RecordDownloadCount(download_stats::CANCELLED_COUNT); TransitionTo(CANCELLED); - StopProgressTimer(); if (user_cancel) download_manager_->DownloadCancelledInternal(this); } @@ -410,7 +389,6 @@ void DownloadItem::OnAllDataSaved(int64 size) { DCHECK(!all_data_saved_); all_data_saved_ = true; UpdateSize(size); - StopProgressTimer(); } void DownloadItem::OnDownloadedFileRemoved() { @@ -481,7 +459,6 @@ void DownloadItem::Interrupted(int64 size, InterruptReason reason) { last_reason_ = reason; UpdateSize(size); - StopProgressTimer(); download_stats::RecordDownloadInterrupted(reason, received_bytes_, total_bytes_); @@ -743,7 +720,6 @@ void DownloadItem::Init(bool active) { UpdateTarget(); if (active) { - StartProgressTimer(); download_stats::RecordDownloadCount(download_stats::START_COUNT); } VLOG(20) << __FUNCTION__ << "() " << DebugString(true); diff --git a/content/browser/download/download_item.h b/content/browser/download/download_item.h index 24a367f..14f873a 100644 --- a/content/browser/download/download_item.h +++ b/content/browser/download/download_item.h @@ -25,7 +25,6 @@ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/time.h" -#include "base/timer.h" #include "content/browser/download/download_id.h" #include "content/browser/download/download_request_handle.h" #include "content/browser/download/download_state_info.h" @@ -359,10 +358,6 @@ class CONTENT_EXPORT DownloadItem { // is completed. void Completed(); - // Start/stop sending periodic updates to our observers - void StartProgressTimer(); - void StopProgressTimer(); - // Call to transition state; all state transitions should go through this. void TransitionTo(DownloadState new_state); @@ -445,9 +440,6 @@ class CONTENT_EXPORT DownloadItem { // Our persistent store handle int64 db_handle_; - // Timer for regularly updating our observers - base::RepeatingTimer<DownloadItem> update_timer_; - // Our owning object DownloadManager* download_manager_; |