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

Unified Diff: third_party/WebKit/Source/platform/PlatformEvent.h

Issue 1936853002: Assert event timestamp to be monotonic and not from future Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change to histogram Created 4 years, 2 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: third_party/WebKit/Source/platform/PlatformEvent.h
diff --git a/third_party/WebKit/Source/platform/PlatformEvent.h b/third_party/WebKit/Source/platform/PlatformEvent.h
index 9a60dce432236401a5f5594e588413788314120a..c03fd4d2023f996e873bc2d44581878964316e2c 100644
--- a/third_party/WebKit/Source/platform/PlatformEvent.h
+++ b/third_party/WebKit/Source/platform/PlatformEvent.h
@@ -27,6 +27,7 @@
#define PlatformEvent_h
#include "wtf/Allocator.h"
+#include "wtf/CurrentTime.h"
#include "wtf/Noncopyable.h"
namespace blink {
@@ -159,6 +160,9 @@ protected:
, m_modifiers(modifiers)
, m_timestamp(timestamp)
{
+ // Verify that timestamp is coming from monotonic clock and not the
+ // wall clock.
+ DCHECK(timestamp <= monotonicallyIncreasingTime());
}
// Explicit protected destructor so that people don't accidentally

Powered by Google App Engine
This is Rietveld 408576698