Chromium Code Reviews| Index: base/time/time_win.cc |
| diff --git a/base/time/time_win.cc b/base/time/time_win.cc |
| index ad3c9914dbdc81cceff83b4698f43252a480ba8b..59e5997123d9e3b41604800c013b779818df010a 100644 |
| --- a/base/time/time_win.cc |
| +++ b/base/time/time_win.cc |
| @@ -42,6 +42,7 @@ |
| #include "base/lazy_instance.h" |
| #include "base/logging.h" |
| #include "base/synchronization/lock.h" |
| +#include "base/threading/platform_thread.h" |
| using base::ThreadTicks; |
| using base::Time; |
| @@ -518,11 +519,17 @@ TimeTicks::Clock TimeTicks::GetClock() { |
| // static |
| ThreadTicks ThreadTicks::Now() { |
| + return ThreadTicks::Now(PlatformThread::CurrentHandle()); |
| +} |
| + |
| +// static |
| +ThreadTicks ThreadTicks::Now(const base::PlatformThreadHandle& thread_handle) { |
| DCHECK(IsSupported()); |
| // Get the number of TSC ticks used by the current thread. |
| ULONG64 thread_cycle_time = 0; |
| - GetQueryThreadCycleTimeFunction()(::GetCurrentThread(), &thread_cycle_time); |
| + GetQueryThreadCycleTimeFunction()(thread_handle.platform_handle(), |
|
fdoray
2016/04/21 21:08:37
We can call ::QueryThreadCycleTime() directly and
stanisc
2016/04/22 01:11:45
OK, I've removed GetQueryThreadCycleTimeFunction()
|
| + &thread_cycle_time); |
| // Get the frequency of the TSC. |
| double tsc_ticks_per_second = TSCTicksPerSecond(); |