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

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

Issue 7812036: Update base/timer.h code to pass through Location from call sites. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_manager.h" 5 #include "content/browser/download/download_file_manager.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 DownloadFile* DownloadFileManager::GetDownloadFile(int id) { 83 DownloadFile* DownloadFileManager::GetDownloadFile(int id) {
84 DownloadFileMap::iterator it = downloads_.find(id); 84 DownloadFileMap::iterator it = downloads_.find(id);
85 return it == downloads_.end() ? NULL : it->second; 85 return it == downloads_.end() ? NULL : it->second;
86 } 86 }
87 87
88 void DownloadFileManager::StartUpdateTimer() { 88 void DownloadFileManager::StartUpdateTimer() {
89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
90 if (!update_timer_.IsRunning()) { 90 if (!update_timer_.IsRunning()) {
91 update_timer_.Start(base::TimeDelta::FromMilliseconds(kUpdatePeriodMs), 91 update_timer_.Start(FROM_HERE,
92 base::TimeDelta::FromMilliseconds(kUpdatePeriodMs),
92 this, &DownloadFileManager::UpdateInProgressDownloads); 93 this, &DownloadFileManager::UpdateInProgressDownloads);
93 } 94 }
94 } 95 }
95 96
96 void DownloadFileManager::StopUpdateTimer() { 97 void DownloadFileManager::StopUpdateTimer() {
97 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 98 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
98 update_timer_.Stop(); 99 update_timer_.Stop();
99 } 100 }
100 101
101 void DownloadFileManager::UpdateInProgressDownloads() { 102 void DownloadFileManager::UpdateInProgressDownloads() {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 << " id = " << id 431 << " id = " << id
431 << " download_file = " << download_file->DebugString(); 432 << " download_file = " << download_file->DebugString();
432 433
433 downloads_.erase(id); 434 downloads_.erase(id);
434 435
435 delete download_file; 436 delete download_file;
436 437
437 if (downloads_.empty()) 438 if (downloads_.empty())
438 StopUpdateTimer(); 439 StopUpdateTimer();
439 } 440 }
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/extension_dispatcher.cc ('k') | content/browser/download/download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698