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

Side by Side Diff: content/browser/download/download_file_impl.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/download/download_file_impl.h" 5 #include "content/browser/download/download_file_impl.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 DownloadFileImpl::~DownloadFileImpl() { 61 DownloadFileImpl::~DownloadFileImpl() {
62 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 62 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
63 --number_active_objects_; 63 --number_active_objects_;
64 } 64 }
65 65
66 void DownloadFileImpl::Initialize(const InitializeCallback& callback) { 66 void DownloadFileImpl::Initialize(const InitializeCallback& callback) {
67 DCHECK_CURRENTLY_ON(BrowserThread::FILE); 67 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
68 68
69 update_timer_.reset(new base::RepeatingTimer<DownloadFileImpl>()); 69 update_timer_.reset(new base::RepeatingTimer());
70 DownloadInterruptReason result = 70 DownloadInterruptReason result =
71 file_.Initialize(default_download_directory_); 71 file_.Initialize(default_download_directory_);
72 if (result != DOWNLOAD_INTERRUPT_REASON_NONE) { 72 if (result != DOWNLOAD_INTERRUPT_REASON_NONE) {
73 BrowserThread::PostTask( 73 BrowserThread::PostTask(
74 BrowserThread::UI, FROM_HERE, base::Bind(callback, result)); 74 BrowserThread::UI, FROM_HERE, base::Bind(callback, result));
75 return; 75 return;
76 } 76 }
77 77
78 stream_reader_->RegisterCallback( 78 stream_reader_->RegisterCallback(
79 base::Bind(&DownloadFileImpl::StreamActive, weak_factory_.GetWeakPtr())); 79 base::Bind(&DownloadFileImpl::StreamActive, weak_factory_.GetWeakPtr()));
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 observer_, file_.bytes_so_far(), CurrentSpeed(), 352 observer_, file_.bytes_so_far(), CurrentSpeed(),
353 GetHashState())); 353 GetHashState()));
354 } 354 }
355 355
356 // static 356 // static
357 int DownloadFile::GetNumberOfDownloadFiles() { 357 int DownloadFile::GetNumberOfDownloadFiles() {
358 return number_active_objects_; 358 return number_active_objects_;
359 } 359 }
360 360
361 } // namespace content 361 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/indexed_db/indexed_db_backing_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698