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

Unified Diff: base/spin_wait.h

Issue 7995: Move Time, TimeDelta and TimeTicks into namespace base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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 side-by-side diff with in-line comments
Download patch
Index: base/spin_wait.h
===================================================================
--- base/spin_wait.h (revision 3954)
+++ base/spin_wait.h (working copy)
@@ -31,14 +31,15 @@
// that the test passes, even if load varies, and external events vary.
#define SPIN_FOR_1_SECOND_OR_UNTIL_TRUE(expression) \
- SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(TimeDelta::FromSeconds(1), (expression))
+ SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(base::TimeDelta::FromSeconds(1), \
+ (expression))
#define SPIN_FOR_TIMEDELTA_OR_UNTIL_TRUE(delta, expression) do { \
- Time start = Time::Now(); \
- const TimeDelta kTimeout = delta; \
+ base::Time start = base::Time::Now(); \
+ const base::TimeDelta kTimeout = delta; \
while(!(expression)) { \
- if (kTimeout < Time::Now() - start) { \
- EXPECT_LE((Time::Now() - start).InMilliseconds(), \
+ if (kTimeout < base::Time::Now() - start) { \
+ EXPECT_LE((base::Time::Now() - start).InMilliseconds(), \
kTimeout.InMilliseconds()) << "Timed out"; \
break; \
} \
@@ -48,4 +49,3 @@
while(0)
#endif // BASE_SPIN_WAIT_H__
-
« no previous file with comments | « base/pr_time_unittest.cc ('k') | base/stats_counters.h » ('j') | base/time_format.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698