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

Unified Diff: Source/web/WebInputEventConversion.cpp

Issue 1352523002: Use high precision timestamp for Event.timestamp (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use m_target to find event document Created 5 years, 3 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
« Source/core/events/Event.idl ('K') | « Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebInputEventConversion.cpp
diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp
index df65059f3854eea1db3b53d39b914e98e04c179d..26772c10a83805a21c78aee6501f64cc83e7a7a6 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -50,8 +50,6 @@
namespace blink {
-static const double millisPerSecond = 1000.0;
-
static float scaleDeltaToWindow(const Widget* widget, float delta)
{
float scale = 1;
@@ -320,6 +318,7 @@ PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder(const WebKeyboardEven
m_key = Platform::current()->domKeyStringFromEnum(e.domKey);
m_modifiers = toPlatformKeyboardEventModifiers(e.modifiers);
+ m_timestamp = e.timeStampSeconds;
// FIXME: PlatformKeyboardEvents expect a locational version of the keycode (e.g. VK_LSHIFT
// instead of VK_SHIFT). This should be changed so the location/keycode are stored separately,
@@ -480,7 +479,7 @@ static IntPoint convertAbsoluteLocationForLayoutObject(const LayoutPoint& locati
// RemoteFrameViews.
static void updateWebMouseEventFromCoreMouseEvent(const MouseRelatedEvent& event, const Widget* widget, const LayoutObject& layoutObject, WebMouseEvent& webEvent)
{
- webEvent.timeStampSeconds = event.timeStamp() / millisPerSecond;
+ webEvent.timeStampSeconds = event.timeStampForPlatformInSeconds();
webEvent.modifiers = getWebInputModifiers(event);
FrameView* view = widget ? toFrameView(widget->parent()) : 0;
@@ -570,7 +569,7 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget, const LayoutObj
else
return;
- timeStampSeconds = event.timeStamp() / millisPerSecond;
+ timeStampSeconds = event.timeStampForPlatformInSeconds();
modifiers = getWebInputModifiers(event);
// The mouse event co-ordinates should be generated from the co-ordinates of the touch point.
@@ -628,7 +627,7 @@ WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
else if (event.location() == KeyboardEvent::DOM_KEY_LOCATION_RIGHT)
modifiers |= WebInputEvent::IsRight;
- timeStampSeconds = event.timeStamp() / millisPerSecond;
+ timeStampSeconds = event.timeStampForPlatformInSeconds();
windowsKeyCode = event.keyCode();
// The platform keyevent does not exist if the event was created using
@@ -721,7 +720,7 @@ WebTouchEventBuilder::WebTouchEventBuilder(const LayoutObject* layoutObject, con
}
modifiers = getWebInputModifiers(event);
- timeStampSeconds = event.timeStamp() / millisPerSecond;
+ timeStampSeconds = event.timeStampForPlatformInSeconds();
cancelable = event.cancelable();
causesScrollingIfUncanceled = event.causesScrollingIfUncanceled();
@@ -756,7 +755,7 @@ WebGestureEventBuilder::WebGestureEventBuilder(const LayoutObject* layoutObject,
data.tap.tapCount = 1;
}
- timeStampSeconds = event.timeStamp() / millisPerSecond;
+ timeStampSeconds = event.timeStampForPlatformInSeconds();
modifiers = getWebInputModifiers(event);
globalX = event.screenX();
« Source/core/events/Event.idl ('K') | « Source/platform/RuntimeEnabledFeatures.in ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698