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

Unified Diff: base/message_pump_glib.cc

Issue 3884001: Switch to using TimeTicks rather than Time in message loops (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 | « base/message_pump_glib.h ('k') | base/message_pump_libevent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_glib.cc
===================================================================
--- base/message_pump_glib.cc (revision 65315)
+++ base/message_pump_glib.cc (working copy)
@@ -21,7 +21,7 @@
// Return a timeout suitable for the glib loop, -1 to block forever,
// 0 to return right away, or a timeout in milliseconds from now.
-int GetTimeIntervalMilliseconds(base::Time from) {
+int GetTimeIntervalMilliseconds(const base::TimeTicks& from) {
if (from.is_null())
return -1;
@@ -29,7 +29,7 @@
// value in milliseconds. If there are 5.5ms left, should the delay be 5 or
// 6? It should be 6 to avoid executing delayed work too early.
int delay = static_cast<int>(
- ceil((from - base::Time::Now()).InMillisecondsF()));
+ ceil((from - base::TimeTicks::Now()).InMillisecondsF()));
// If this value is negative, then we need to run delayed work soon.
return delay < 0 ? 0 : delay;
@@ -333,7 +333,7 @@
}
}
-void MessagePumpForUI::ScheduleDelayedWork(const Time& delayed_work_time) {
+void MessagePumpForUI::ScheduleDelayedWork(const TimeTicks& delayed_work_time) {
// We need to wake up the loop in case the poll timeout needs to be
// adjusted. This will cause us to try to do work, but that's ok.
delayed_work_time_ = delayed_work_time;
« no previous file with comments | « base/message_pump_glib.h ('k') | base/message_pump_libevent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698