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

Unified Diff: content/renderer/load_progress_tracker.cc

Issue 9233018: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/ppapi_plugin/plugin_process_dispatcher.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/load_progress_tracker.cc
diff --git a/content/renderer/load_progress_tracker.cc b/content/renderer/load_progress_tracker.cc
index cc153f6e8761e2c34b3d1d81481407fb612a2a00..9a462052cc0255208655a2559d773b2a05d30283 100644
--- a/content/renderer/load_progress_tracker.cc
+++ b/content/renderer/load_progress_tracker.cc
@@ -51,9 +51,11 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame,
// last updates. Also, since the message loop may be pretty busy when a page
// is loaded, it might not execute a posted task in a timely manner so we make
// sure to immediately send progress report if enough time has passed.
+ base::TimeDelta min_delay =
+ base::TimeDelta::FromMilliseconds(kMinimumDelayBetweenUpdatesMS);
if (progress == 1.0 || last_time_progress_sent_.is_null() ||
- (base::TimeTicks::Now() - last_time_progress_sent_).InMilliseconds() >
- kMinimumDelayBetweenUpdatesMS) {
+ base::TimeTicks::Now() - last_time_progress_sent_ >
+ min_delay) {
// If there is a pending task to send progress, it is now obsolete.
weak_factory_.InvalidateWeakPtrs();
SendChangeLoadProgress();
@@ -69,7 +71,7 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame,
FROM_HERE,
base::Bind(&LoadProgressTracker::SendChangeLoadProgress,
weak_factory_.GetWeakPtr()),
- kMinimumDelayBetweenUpdatesMS);
+ min_delay);
}
void LoadProgressTracker::SendChangeLoadProgress() {
« no previous file with comments | « content/ppapi_plugin/plugin_process_dispatcher.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698