Issue metadata
Sign in to add a comment
|
GamepadEvent.timeStamp should use the OS provided timestamp |
||||||||||||||||||||
Issue descriptionInstead of using TimeTicks::Now() we should initialized the Gamepad Events with the OS provided timestamp [1]. This is just basically a matter of converting the timestamp to TimeTicks and using an alternative Event ctor here [2]. [1]https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/modules/gamepad/Gamepad.h?type=cs&l=89 [2] https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/modules/gamepad/GamepadEvent.cpp?type=cs&l=9
,
Nov 6 2017
Great! I hope the info in comment #1 is enough to get you started. Otherwise feel free to ask any questions you may have and I will try to help find you the right answers. Also I will be happy to be your first reviewer once you have a patch up for review. Great! I hope the info in comment #1 is enough to get you started. Otherwise feel free to ask any questions you may have and I will try to help find you the right answers. Also I will be happy to be your first reviewer once you have a patch up for review. BTW, I mark the bug "assigned" but I cannot seem to be able to assign it to you given that you are not a project member yet. So I put myself as the "owner" but it is yours.
,
Nov 6 2017
,
Nov 7 2017
Thanks, currently working on it, I will send you a patch ASAP
,
Nov 7 2017
Ok, correct me if I am wrong: The only thing that I have to do is to get the OS timestamp, convert it to TimeTicks and then change the timestamp value of the gamepad that is being passed on this line of the constructor? https://codesearch.chromium.org/chromium/src/third_party/WebKit/Source/modules/gamepad/GamepadEvent.cpp?type=cs&l=13
,
Nov 7 2017
That is correct. If you pass in a valid TimeTicks to blink::Event constructor (i.e., as the platform_time_stamp) then that timestamp will be the one exposed to Javascript. Note that blink::Event constructor expects to received a base::TimeTicks that comes from the same clock as base::TimeTicks::Now() [1]. So you need to make sure that invariant is true when converting the OS provided timestamp to base::TimeTicks. I am not familiar with gamepad APIs so I am not sure what clock their timestamp uses (This may actually be platform specific). But for examples on Linux for Xinput events we had to have special logic to ensure the X11 timestamps for input events are properly converted to base::TimeTicks. [2] [1] https://codesearch.chromium.org/chromium/src/base/time/time.h?type=cs&sq=package:chromium&l=765 [2] https://codesearch.chromium.org/chromium/src/ui/events/x/events_x.cc?type=cs&l=87
,
Nov 10 2017
We have decided to no do anything here. So closing as WONTFIX. Details of discussion are in [1] but ere is a summary: First, there is a difference between Gamepad.timestamp and GamepadEvent.timestamp. Second, getting an "OS timestamp" that can be converted to time tick is going to be a lot of work. And even then, these timestamps may not really be that relevant to the connect/disconnect events but rather the last data poll. Third, GamepageEvents are only dispatched for connect/disconnect so they are not high-frequency unlike Gamepad button changes that are polled at a hi-freq. Given these, for GamepadEvent (e.g., connect/disconnect), we think it is good enough to use the moment of creation of the event as the event timestamp. This is what we do for many other event types and it was already the case. So no change is needed. There is already a bug for tracking any changes needed for Gamepad.timestamp. Issue 398642 [1] https://chromium-review.googlesource.com/c/chromium/src/+/757832
,
Nov 26 2017
The NextAction date has arrived: 2017-11-26 |
|||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||
Comment 1 by jj.lopez...@gmail.com
, Nov 4 2017