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

Side by Side Diff: base/time_posix.cc

Issue 7995: Move Time, TimeDelta and TimeTicks into namespace base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/time.h" 5 #include "base/time.h"
6 6
7 #ifdef OS_MACOSX 7 #ifdef OS_MACOSX
8 #include <mach/mach_time.h> 8 #include <mach/mach_time.h>
9 #endif 9 #endif
10 #include <sys/time.h> 10 #include <sys/time.h>
11 #include <time.h> 11 #include <time.h>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 15
16 namespace base {
17
16 // The Time routines in this file use standard POSIX routines, or almost- 18 // The Time routines in this file use standard POSIX routines, or almost-
17 // standard routines in the case of timegm. We need to use a Mach-specific 19 // standard routines in the case of timegm. We need to use a Mach-specific
18 // function for TimeTicks::Now() on Mac OS X. 20 // function for TimeTicks::Now() on Mac OS X.
19 21
20 // Time ----------------------------------------------------------------------- 22 // Time -----------------------------------------------------------------------
21 23
22 // The internal representation of Time uses time_t directly, so there is no 24 // The internal representation of Time uses time_t directly, so there is no
23 // offset. The epoch is 1970-01-01 00:00:00 UTC. 25 // offset. The epoch is 1970-01-01 00:00:00 UTC.
24 // static 26 // static
25 const int64 Time::kTimeTToMicrosecondsOffset = GG_INT64_C(0); 27 const int64 Time::kTimeTToMicrosecondsOffset = GG_INT64_C(0);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 #error No usable tick clock function on this platform. 135 #error No usable tick clock function on this platform.
134 #endif // _POSIX_MONOTONIC_CLOCK 136 #endif // _POSIX_MONOTONIC_CLOCK
135 137
136 return TimeTicks(absolute_micro); 138 return TimeTicks(absolute_micro);
137 } 139 }
138 140
139 // static 141 // static
140 TimeTicks TimeTicks::HighResNow() { 142 TimeTicks TimeTicks::HighResNow() {
141 return Now(); 143 return Now();
142 } 144 }
145
146 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698