Chromium Code Reviews| 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..004dbfad28882e353c6d14d323b00aebf1dcbcf5 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_; |
| + |
| + // For remote times that fall outside of 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_ || |
| + remote_upper_bound_ < remote_ms.value_) { |
| + return LocalTimeTicks(local_base_time_ + remote_delta.value_); |
|
mmenke
2016/03/28 18:04:54
Shouldn't this be:
if (remote_ms.value_ < remote_
|
| + } |
| return LocalTimeTicks(local_base_time_ + |
| ToLocalTimeDelta(remote_delta).value_); |
| } |