Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_ | 5 #ifndef COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_ |
| 6 #define COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_ | 6 #define COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 39 | 39 |
| 40 // Clock resolution is platform dependent. | 40 // Clock resolution is platform dependent. |
| 41 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 42 const int64_t kTicksResolutionMs = base::Time::kMinLowResolutionThresholdMs; | 42 const int64_t kTicksResolutionMs = base::Time::kMinLowResolutionThresholdMs; |
| 43 #else | 43 #else |
| 44 const int64_t kTicksResolutionMs = 1; // Assume 1ms for non-windows platforms. | 44 const int64_t kTicksResolutionMs = 1; // Assume 1ms for non-windows platforms. |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 // Variations Service feature that enables network time service querying. | 47 // Variations Service feature that enables network time service querying. |
| 48 extern const base::Feature kNetworkTimeServiceQuerying; | 48 extern const base::Feature kNetworkTimeServiceQuerying; |
| 49 // Parameter name for the network time experiment that controls whether | |
| 50 // time queries can be issued on-demand. | |
|
jwd
2016/11/03 15:15:34
Seeing as I've asked you to reduce the magicness o
| |
| 51 extern const char kVariationsServiceEnableFetchesOnDemand[]; | |
| 49 | 52 |
| 50 // A class that receives network time updates and can provide the network time | 53 // A class that receives network time updates and can provide the network time |
| 51 // for a corresponding local time. This class is not thread safe. | 54 // for a corresponding local time. This class is not thread safe. |
| 52 class NetworkTimeTracker : public net::URLFetcherDelegate { | 55 class NetworkTimeTracker : public net::URLFetcherDelegate { |
| 53 public: | 56 public: |
| 54 // Describes the result of a GetNetworkTime() call, describing whether | 57 // Describes the result of a GetNetworkTime() call, describing whether |
| 55 // network time was available and if not, why not. | 58 // network time was available and if not, why not. |
| 56 enum NetworkTimeResult { | 59 enum NetworkTimeResult { |
| 57 // Network time is available. | 60 // Network time is available. |
| 58 NETWORK_TIME_AVAILABLE, | 61 NETWORK_TIME_AVAILABLE, |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 std::vector<base::Closure> fetch_completion_callbacks_; | 204 std::vector<base::Closure> fetch_completion_callbacks_; |
| 202 | 205 |
| 203 base::ThreadChecker thread_checker_; | 206 base::ThreadChecker thread_checker_; |
| 204 | 207 |
| 205 DISALLOW_COPY_AND_ASSIGN(NetworkTimeTracker); | 208 DISALLOW_COPY_AND_ASSIGN(NetworkTimeTracker); |
| 206 }; | 209 }; |
| 207 | 210 |
| 208 } // namespace network_time | 211 } // namespace network_time |
| 209 | 212 |
| 210 #endif // COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_ | 213 #endif // COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_ |
| OLD | NEW |