}
ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) {
- ui::LatencyInfo latency_info;
+ if (!event.TimeStamp().since_origin().InMicroseconds())
+ return ui::LatencyInfo();
+
// The latency number should only be added if the timestamp is valid.
-#if !defined(EWK_BRINGUP) // FIXME: m69 bringup
- if (event.TimeStampSeconds()) {
- const int64_t time_micros = static_cast<int64_t>(
- event.TimeStampSeconds() * base::Time::kMicrosecondsPerSecond);
- latency_info.AddLatencyNumberWithTimestamp(
- ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, 0,
- base::TimeTicks() + base::TimeDelta::FromMicroseconds(time_micros), 1);
- }
-#endif
+ ui::LatencyInfo latency_info;
+ const int64_t time_micros = event.TimeStamp().since_origin().InMicroseconds();
+ latency_info.AddLatencyNumberWithTimestamp(
+ ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT,
+ base::TimeTicks() + base::TimeDelta::FromMicroseconds(time_micros));
return latency_info;
}