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

Side by Side Diff: net/base/network_time_notifier.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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 | Annotate | Revision Log
« no previous file with comments | « net/base/net_util_win.cc ('k') | net/base/platform_mime_util_win.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "net/base/network_time_notifier.h" 5 #include "net/base/network_time_notifier.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/i18n/time_formatting.h" 9 #include "base/i18n/time_formatting.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 NetworkTimeNotifier::~NetworkTimeNotifier() {} 36 NetworkTimeNotifier::~NetworkTimeNotifier() {}
37 37
38 void NetworkTimeNotifier::UpdateNetworkTime(const base::Time& network_time, 38 void NetworkTimeNotifier::UpdateNetworkTime(const base::Time& network_time,
39 const base::TimeDelta& resolution, 39 const base::TimeDelta& resolution,
40 const base::TimeDelta& latency, 40 const base::TimeDelta& latency,
41 const base::TimeTicks& post_time) { 41 const base::TimeTicks& post_time) {
42 DCHECK(thread_checker_.CalledOnValidThread()); 42 DCHECK(thread_checker_.CalledOnValidThread());
43 DVLOG(1) << "Network time updating to " 43 DVLOG(1) << "Network time updating to "
44 << UTF16ToUTF8(base::TimeFormatFriendlyDateAndTime(network_time)); 44 << base::UTF16ToUTF8(
45 base::TimeFormatFriendlyDateAndTime(network_time));
45 // Update network time on every request to limit dependency on ticks lag. 46 // Update network time on every request to limit dependency on ticks lag.
46 // TODO(mad): Find a heuristic to avoid augmenting the 47 // TODO(mad): Find a heuristic to avoid augmenting the
47 // network_time_uncertainty_ too much by a particularly long latency. 48 // network_time_uncertainty_ too much by a particularly long latency.
48 // Maybe only update when the the new time either improves in accuracy or 49 // Maybe only update when the the new time either improves in accuracy or
49 // drifts too far from |network_time_|. 50 // drifts too far from |network_time_|.
50 network_time_ = network_time; 51 network_time_ = network_time;
51 52
52 // Calculate the delay since the network time was received. 53 // Calculate the delay since the network time was received.
53 base::TimeTicks now = tick_clock_->NowTicks(); 54 base::TimeTicks now = tick_clock_->NowTicks();
54 base::TimeDelta task_delay = now - post_time; 55 base::TimeDelta task_delay = now - post_time;
(...skipping 27 matching lines...) Expand all
82 base::MessageLoop::current()->PostTask( 83 base::MessageLoop::current()->PostTask(
83 FROM_HERE, 84 FROM_HERE,
84 base::Bind(observer_callback, 85 base::Bind(observer_callback,
85 network_time_, 86 network_time_,
86 network_time_ticks_, 87 network_time_ticks_,
87 network_time_uncertainty_)); 88 network_time_uncertainty_));
88 } 89 }
89 } 90 }
90 91
91 } // namespace net 92 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util_win.cc ('k') | net/base/platform_mime_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698