Change blink::WebInputEvent timestamp from double to base::TimeTicks.
Using a double timestamp is prone to errors, since nothing stops a
numerical quantity with the wrong units from being passed in (or even
worse... random unscoped enumerators).
Instead, just use base::TimeTicks directly in blink::WebInputEvent:
this allows all the conversions between base::TimeTicks and doubles to
be removed and ensures better type-safety throughout the code. Several
methods in the Blink public API have also been converted to pass time as
base::TimeTicks, though those changes are limited to avoid changing the
entire codebase in one CL.
Bug: 763980
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2;luci.chromium.try:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I258486006302d010b121b39628ca3e8b3d71491f
Reviewed-on: https://chromium-review.googlesource.com/793050
Commit-Queue: Daniel Cheng <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Dave Tapuska <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Cr-Commit-Position: refs/heads/master@{#553460}
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 448ad33..805fedd 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -930,15 +930,13 @@
has_scrolled_by_touch);
}
-void RenderWidget::BeginMainFrame(double frame_time_sec) {
+void RenderWidget::BeginMainFrame(base::TimeTicks frame_time) {
if (!GetWebWidget())
return;
- if (input_event_queue_) {
- input_event_queue_->DispatchRafAlignedInput(
- ui::EventTimeStampFromSeconds(frame_time_sec));
- }
+ if (input_event_queue_)
+ input_event_queue_->DispatchRafAlignedInput(frame_time);
- GetWebWidget()->BeginFrame(frame_time_sec);
+ GetWebWidget()->BeginFrame(frame_time);
}
void RenderWidget::RequestNewLayerTreeFrameSink(