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

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: fixed tests 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
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/common/inter_process_time_ticks_converter_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
}
« no previous file with comments | « content/child/web_url_loader_impl.cc ('k') | content/common/inter_process_time_ticks_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698