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 #ifndef CONTENT_COMMON_INTER_PROCESS_TIME_TICKS_CONVERTER_H_ | 5 #ifndef CONTENT_COMMON_INTER_PROCESS_TIME_TICKS_CONVERTER_H_ |
6 #define CONTENT_COMMON_INTER_PROCESS_TIME_TICKS_CONVERTER_H_ | 6 #define CONTENT_COMMON_INTER_PROCESS_TIME_TICKS_CONVERTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 | 14 |
15 class LocalTimeDelta; | 15 class LocalTimeDelta; |
16 class LocalTimeTicks; | 16 class LocalTimeTicks; |
17 class RemoteTimeDelta; | 17 class RemoteTimeDelta; |
18 class RemoteTimeTicks; | 18 class RemoteTimeTicks; |
19 | 19 |
20 // On Windows, TimeTicks are not consistent between processes. Often, the values | 20 // On Windows, TimeTicks are not always consistent between processes as |
21 // on one process have a static offset relative to another. Occasionally, these | 21 // indicated by |TimeTicks::IsConsistentAcrossProcesses()|. Often, the values on |
| 22 // one process have a static offset relative to another. Occasionally, these |
22 // offsets shift while running. | 23 // offsets shift while running. |
23 // | 24 // |
24 // To combat this, any TimeTicks values sent from the remote process to the | 25 // To combat this, any TimeTicks values sent from the remote process to the |
25 // local process must be tweaked in order to appear monotonic. | 26 // local process must be tweaked in order to appear monotonic. |
26 // | 27 // |
27 // In order to properly tweak ticks, we need 4 reference points: | 28 // In order to properly tweak ticks, we need 4 reference points: |
28 // | 29 // |
29 // - |local_lower_bound|: A known point, recorded on the local process, that | 30 // - |local_lower_bound|: A known point, recorded on the local process, that |
30 // occurs before any remote values that will be | 31 // occurs before any remote values that will be |
31 // converted. | 32 // converted. |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 friend class InterProcessTimeTicksConverter; | 151 friend class InterProcessTimeTicksConverter; |
151 | 152 |
152 RemoteTimeTicks(int64_t value) : value_(value) {} | 153 RemoteTimeTicks(int64_t value) : value_(value) {} |
153 | 154 |
154 int64_t value_; | 155 int64_t value_; |
155 }; | 156 }; |
156 | 157 |
157 } // namespace content | 158 } // namespace content |
158 | 159 |
159 #endif // CONTENT_COMMON_INTER_PROCESS_TIME_TICKS_CONVERTER_H_ | 160 #endif // CONTENT_COMMON_INTER_PROCESS_TIME_TICKS_CONVERTER_H_ |
OLD | NEW |