Closed Bug 1261894 Opened 4 years ago Closed 3 years ago

High-res timestamp for devicemotion events should use values from device sensor rather than Gecko

Categories

(Firefox for Android :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 54
Tracking Status
firefox54 --- fixed

People

(Reporter: droeh, Assigned: droeh)

References

Details

Attachments

(1 file)

Similar to bug 1222098, but for high-res timestamps.
Hi Dylan, do you have any plans to work on this? I'd like to ship the changes to Event.timeStamp in Firefox 54. Do you think this needs to block that?
Flags: needinfo?(droeh)
If that means turning on high-res timestamps on Android, then doing so will basically regress bug 1222098, yes. I had a patch for that bug that handled high-res timestamps with a simple but somewhat ugly workaround; see comment 14 there.
Flags: needinfo?(droeh)
Ok, then it looks like we need to handle high-res TimeStamps in that code since the high-res timestamp pref is set to ride the trains with Firefox 54. Are you able to work on this?
Flags: needinfo?(droeh)
Sure, here's a patch. Flagging smaug for review since it was his decision not to include this as part of the patch for bug 1222098.
Assignee: nobody → droeh
Flags: needinfo?(droeh)
Attachment #8842041 - Flags: review?(bugs)
Comment on attachment 8842041 [details] [diff] [review]
High-res timestamp fix for DeviceMotion events

>+
>+    static mozilla::TimeStamp tsnow = mozilla::TimeStamp::Now();
>+    static uint64_t first = aTimeStamp.Value();
Could you perhaps rename the variables.
sInitialNow and sFirstEventTime or something


Would be good to compare what kinds of timestamps we get in Chrome vs this patch.
Attachment #8842041 - Flags: review?(bugs) → review+
Pushed by droeh@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7b406378bfe5
Update InitDeviceMotionEvent to handle high-res timestamps. r=smaug
https://hg.mozilla.org/mozilla-central/rev/7b406378bfe5
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54
You need to log in before you can comment on or make changes to this bug.