OLD | NEW |
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 // Time represents an absolute point in time, internally represented as | 5 // Time represents an absolute point in time, internally represented as |
6 // microseconds (s/1,000,000) since a platform-dependent epoch. Each | 6 // microseconds (s/1,000,000) since a platform-dependent epoch. Each |
7 // platform's epoch, along with other system-dependent clock interface | 7 // platform's epoch, along with other system-dependent clock interface |
8 // routines, is defined in time_PLATFORM.cc. | 8 // routines, is defined in time_PLATFORM.cc. |
9 // | 9 // |
10 // TimeDelta represents a duration of time, internally represented in | 10 // TimeDelta represents a duration of time, internally represented in |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 // Converts time to/from a double which is the number of seconds since epoch | 222 // Converts time to/from a double which is the number of seconds since epoch |
223 // (Jan 1, 1970). Webkit uses this format to represent time. | 223 // (Jan 1, 1970). Webkit uses this format to represent time. |
224 static Time FromDoubleT(double dt); | 224 static Time FromDoubleT(double dt); |
225 double ToDoubleT() const; | 225 double ToDoubleT() const; |
226 | 226 |
227 | 227 |
228 #if defined(OS_WIN) | 228 #if defined(OS_WIN) |
229 static Time FromFileTime(FILETIME ft); | 229 static Time FromFileTime(FILETIME ft); |
230 FILETIME ToFileTime() const; | 230 FILETIME ToFileTime() const; |
| 231 |
| 232 // Monitor system power state and disable high resolution timer when we're |
| 233 // on battery. See time_win.cc for more details. |
| 234 static void StartSystemMonitorObserver(); |
| 235 |
| 236 // Enable high resolution timer unconditionally. Only for test code. |
| 237 static void EnableHiResClockForTests(); |
231 #endif | 238 #endif |
232 | 239 |
233 // Converts an exploded structure representing either the local time or UTC | 240 // Converts an exploded structure representing either the local time or UTC |
234 // into a Time class. | 241 // into a Time class. |
235 static Time FromUTCExploded(const Exploded& exploded) { | 242 static Time FromUTCExploded(const Exploded& exploded) { |
236 return FromExploded(false, exploded); | 243 return FromExploded(false, exploded); |
237 } | 244 } |
238 static Time FromLocalExploded(const Exploded& exploded) { | 245 static Time FromLocalExploded(const Exploded& exploded) { |
239 return FromExploded(true, exploded); | 246 return FromExploded(true, exploded); |
240 } | 247 } |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 #endif | 482 #endif |
476 }; | 483 }; |
477 | 484 |
478 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { | 485 inline TimeTicks TimeDelta::operator+(TimeTicks t) const { |
479 return TimeTicks(t.ticks_ + delta_); | 486 return TimeTicks(t.ticks_ + delta_); |
480 } | 487 } |
481 | 488 |
482 } // namespace base | 489 } // namespace base |
483 | 490 |
484 #endif // BASE_TIME_H_ | 491 #endif // BASE_TIME_H_ |
OLD | NEW |