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

Side by Side Diff: content/browser/download/download_item.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_item.h" 5 #include "content/browser/download/download_item.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/i18n/case_conversion.h" 10 #include "base/i18n/case_conversion.h"
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // revert to 'unknown size mode'. 319 // revert to 'unknown size mode'.
320 if (received_bytes_ > total_bytes_) 320 if (received_bytes_ > total_bytes_)
321 total_bytes_ = 0; 321 total_bytes_ = 0;
322 } 322 }
323 323
324 void DownloadItem::StartProgressTimer() { 324 void DownloadItem::StartProgressTimer() {
325 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. 325 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved.
326 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 326 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
327 327
328 update_timer_.Start(base::TimeDelta::FromMilliseconds(kUpdateTimeMs), this, 328 update_timer_.Start(base::TimeDelta::FromMilliseconds(kUpdateTimeMs), this,
329 &DownloadItem::UpdateObservers); 329 &DownloadItem::UpdateObservers, FROM_HERE);
330 } 330 }
331 331
332 void DownloadItem::StopProgressTimer() { 332 void DownloadItem::StopProgressTimer() {
333 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. 333 // TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved.
334 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 334 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
335 335
336 update_timer_.Stop(); 336 update_timer_.Stop();
337 } 337 }
338 338
339 // Updates from the download thread may have been posted while this download 339 // Updates from the download thread may have been posted while this download
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 state_info_.target_name.value().c_str(), 796 state_info_.target_name.value().c_str(),
797 full_path().value().c_str()); 797 full_path().value().c_str());
798 } else { 798 } else {
799 description += base::StringPrintf(" url = \"%s\"", url_list.c_str()); 799 description += base::StringPrintf(" url = \"%s\"", url_list.c_str());
800 } 800 }
801 801
802 description += " }"; 802 description += " }";
803 803
804 return description; 804 return description;
805 } 805 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698