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

Side by Side Diff: components/network_time/network_time_tracker.cc

Issue 1651203002: Update components for new prefs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 unified diff | Download patch
« no previous file with comments | « components/network_time/DEPS ('k') | components/network_time/network_time_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "components/network_time/network_time_tracker.h" 5 #include "components/network_time/network_time_tracker.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/prefs/pref_registry_simple.h"
13 #include "base/prefs/pref_service.h"
14 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
15 #include "base/time/tick_clock.h" 13 #include "base/time/tick_clock.h"
16 #include "build/build_config.h" 14 #include "build/build_config.h"
17 #include "components/network_time/network_time_pref_names.h" 15 #include "components/network_time/network_time_pref_names.h"
16 #include "components/prefs/pref_registry_simple.h"
17 #include "components/prefs/pref_service.h"
18 18
19 namespace network_time { 19 namespace network_time {
20 20
21 namespace { 21 namespace {
22 22
23 // Clock resolution is platform dependent. 23 // Clock resolution is platform dependent.
24 #if defined(OS_WIN) 24 #if defined(OS_WIN)
25 const int64_t kTicksResolutionMs = base::Time::kMinLowResolutionThresholdMs; 25 const int64_t kTicksResolutionMs = base::Time::kMinLowResolutionThresholdMs;
26 #else 26 #else
27 const int64_t kTicksResolutionMs = 1; // Assume 1ms for non-windows platforms. 27 const int64_t kTicksResolutionMs = 1; // Assume 1ms for non-windows platforms.
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (network_time_.is_null()) 119 if (network_time_.is_null())
120 return false; 120 return false;
121 DCHECK(!network_time_ticks_.is_null()); 121 DCHECK(!network_time_ticks_.is_null());
122 *network_time = network_time_ + (time_ticks - network_time_ticks_); 122 *network_time = network_time_ + (time_ticks - network_time_ticks_);
123 if (uncertainty) 123 if (uncertainty)
124 *uncertainty = network_time_uncertainty_; 124 *uncertainty = network_time_uncertainty_;
125 return true; 125 return true;
126 } 126 }
127 127
128 } // namespace network_time 128 } // namespace network_time
OLDNEW
« no previous file with comments | « components/network_time/DEPS ('k') | components/network_time/network_time_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698