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

Unified Diff: base/time/time_win.cc

Issue 2090783002: Limit InterProcessTimeTicksConverter to platforms that require it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mac Created 4 years, 6 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/time/time_win.cc
diff --git a/base/time/time_win.cc b/base/time/time_win.cc
index 8708eb21c90697112771f8a31a4490fa43ebd127..ca5e793943876fa9138fbcd8b2e587e0854feaf4 100644
--- a/base/time/time_win.cc
+++ b/base/time/time_win.cc
@@ -504,6 +504,26 @@ bool TimeTicks::IsHighResolution() {
}
// static
+bool TimeTicks::IsConsistentAcrossProcesses() {
+ // According to Windows documentation [1] QPC is consistent Post-Windows Visa.
+ // So if we are using QPC then we are consistent which is the same as being
+ // high reolution.
+ //
+ // [1] https://msdn.microsoft.com/en-us/library/windows/desktop/dn553408(v=vs.85).aspx
+ //
+ // "In general, the performance counter results are consistent across all
+ // processors in multi-core and multi-processor systems, even when measured on
+ // different threads or processes. Here are some exceptions to this rule:
+ // - Pre-Windows Vista operating systems that run on certain processors might
+ // violate this consistency because of one of these reasons:
+ // 1. The hardware processors have a non-invariant TSC and the BIOS
+ // doesn't indicate this condition correctly.
+ // 2. The TSC synchronization algorithm that was used wasn't suitable for
+ // systems with large numbers of processors."
+ return IsHighResolution();
+}
+
+// static
TimeTicks::Clock TimeTicks::GetClock() {
return IsHighResolution() ?
Clock::WIN_QPC : Clock::WIN_ROLLOVER_PROTECTED_TIME_GET_TIME;

Powered by Google App Engine
This is Rietveld 408576698