OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/common/inter_process_time_ticks_converter.h" | 5 #include "content/common/inter_process_time_ticks_converter.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 return LocalTimeDelta(Convert(remote_delta.value_)); | 65 return LocalTimeDelta(Convert(remote_delta.value_)); |
66 } | 66 } |
67 | 67 |
68 int64 InterProcessTimeTicksConverter::Convert(int64 value) const { | 68 int64 InterProcessTimeTicksConverter::Convert(int64 value) const { |
69 if (value <= 0) { | 69 if (value <= 0) { |
70 return value; | 70 return value; |
71 } | 71 } |
72 return numerator_ * value / denominator_; | 72 return numerator_ * value / denominator_; |
73 } | 73 } |
74 | 74 |
75 bool InterProcessTimeTicksConverter::IsSkewAdditiveForMetrics() const { | |
76 return numerator_ == 1 && denominator_ == 1; | |
pasko
2014/08/18 09:30:34
I guess non-additive cases are assumed to be low,
| |
77 } | |
78 | |
79 base::TimeDelta InterProcessTimeTicksConverter::GetSkewForMetrics() const { | |
80 return base::TimeTicks::FromInternalValue(remote_lower_bound_) - | |
81 base::TimeTicks::FromInternalValue(local_base_time_); | |
82 } | |
83 | |
75 } // namespace content | 84 } // namespace content |
OLD | NEW |