Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Unified Diff: content/common/inter_process_time_ticks_converter.cc

Issue 1828203005: Expose SPDY pushes in DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added a test Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_);
}

Powered by Google App Engine
This is Rietveld 408576698