Index: base/time/time_win.cc |
diff --git a/base/time/time_win.cc b/base/time/time_win.cc |
index e9044603e9aedf7a7841d6f2e8406ad68289f291..1897b04995bb9cb916860b4db67ea29f35db5940 100644 |
--- a/base/time/time_win.cc |
+++ b/base/time/time_win.cc |
@@ -436,22 +436,19 @@ void InitializeNowFunctionPointers() { |
// TraceTicks::Now() must use the low-resolution clock. |
// |
// If the QPC implementation is expensive and/or unreliable, TimeTicks::Now() |
- // will use the low-resolution clock, but TraceTicks::Now() will use the QPC |
- // (in the hope that it is still useful for tracing purposes). A CPU lacking a |
- // non-stop time counter will cause Windows to provide an alternate QPC |
- // implementation that works, but is expensive to use. Certain Athlon CPUs are |
- // known to make the QPC implementation unreliable. |
+ // and TraceTicks::Now() will still use the low-resolution clock. A CPU |
+ // lacking a non-stop time counter will cause Windows to provide an alternate |
+ // QPC implementation that works, but is expensive to use. Certain Athlon CPUs |
+ // are known to make the QPC implementation unreliable. |
// |
// Otherwise, both Now functions can use the high-resolution QPC clock. As of |
- // 4 January 2015, ~68% of users fall within this category. |
+ // 21 August 2015, ~72% of users fall within this category. |
NowFunction now_function; |
NowFunction system_trace_now_function; |
base::CPU cpu; |
- if (ticks_per_sec.QuadPart <= 0) { |
+ if (ticks_per_sec.QuadPart <= 0 || |
+ !cpu.has_non_stop_time_stamp_counter() || IsBuggyAthlon(cpu)) { |
now_function = system_trace_now_function = &RolloverProtectedNow; |
fmeawad
2015/08/21 21:24:40
Can you explain why you still need 2 variable (now
|
- } else if (!cpu.has_non_stop_time_stamp_counter() || IsBuggyAthlon(cpu)) { |
- now_function = &RolloverProtectedNow; |
- system_trace_now_function = &QPCNow; |
} else { |
now_function = system_trace_now_function = &QPCNow; |
} |