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..c6ccd492a94f12b89da6065afae880e015987dd9 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 beforeremote time range, apply just time |
|
mmenke
2016/04/08 16:21:36
beforeremote -> before remote
caseq
2016/04/08 22:39:28
Done.
|
| + // 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_); |
| } |