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

Unified Diff: third_party/WebKit/Source/core/events/KeyboardEvent.cpp

Issue 2542693002: Use WTF::TimeTicks to represent timestamp in Platform/Core event types (Closed)
Patch Set: Minor fixes and revert change in histogram Created 4 years 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/core/events/KeyboardEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/KeyboardEvent.cpp b/third_party/WebKit/Source/core/events/KeyboardEvent.cpp
index ed4874279a25fee3e14338e647b6fb64e540d61b..1cd5849840dad28d879040e01b78502043ae1d7d 100644
--- a/third_party/WebKit/Source/core/events/KeyboardEvent.cpp
+++ b/third_party/WebKit/Source/core/events/KeyboardEvent.cpp
@@ -63,6 +63,10 @@ KeyboardEvent::KeyLocationCode keyLocationCode(const WebInputEvent& key) {
return KeyboardEvent::kDomKeyLocationStandard;
}
+TimeTicks timeStampSecondsToTimeTicks(double seconds) {
+ return TimeTicks() + TimeDelta::FromSecondsD(seconds);
+}
+
bool hasCurrentComposition(LocalDOMWindow* domWindow) {
if (!domWindow)
return false;
@@ -95,7 +99,7 @@ KeyboardEvent::KeyboardEvent(const WebKeyboardEvent& key,
domWindow,
0,
static_cast<PlatformEvent::Modifiers>(key.modifiers),
- key.timeStampSeconds,
+ timeStampSecondsToTimeTicks(key.timeStampSeconds),
InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities()),
m_keyEvent(makeUnique<WebKeyboardEvent>(key)),
// TODO(crbug.com/482880): Fix this initialization to lazy initialization.

Powered by Google App Engine
This is Rietveld 408576698