Index: content/common/inter_process_time_ticks_converter.cc |
diff --git a/content/common/inter_process_time_ticks_converter.cc b/content/common/inter_process_time_ticks_converter.cc |
index d963ead5c4a838bcc30ec802538bbd55b188dba0..f50aa3e550ba3ae5612c9d36b215761bd49c1a95 100644 |
--- a/content/common/inter_process_time_ticks_converter.cc |
+++ b/content/common/inter_process_time_ticks_converter.cc |
@@ -52,9 +52,16 @@ LocalTimeTicks InterProcessTimeTicksConverter::ToLocalTimeTicks( |
// If input time is "null", return another "null" time. |
if (remote_ms.value_ == 0) |
return LocalTimeTicks(0); |
- DCHECK_LE(remote_lower_bound_, remote_ms.value_); |
- DCHECK_GE(remote_upper_bound_, remote_ms.value_); |
+ |
RemoteTimeDelta remote_delta = remote_ms - remote_lower_bound_; |
+ |
+ DCHECK_LE(remote_ms.value_, remote_upper_bound_); |
+ // For remote times that come before remote time range, apply just time |
+ // offset and ignore scaling, so as to avoid extrapolation error for values |
+ // long in the past. |
+ if (remote_ms.value_ < remote_lower_bound_) |
+ return LocalTimeTicks(local_base_time_ + remote_delta.value_); |
+ |
return LocalTimeTicks(local_base_time_ + |
ToLocalTimeDelta(remote_delta).value_); |
} |