OLD | NEW |
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 "chrome/browser/net/network_time_tracker.h" | 5 #include "chrome/browser/net/network_time_tracker.h" |
6 | 6 |
7 #include "base/sequenced_task_runner.h" | 7 #include "base/sequenced_task_runner.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/io_thread.h" | 9 #include "chrome/browser/io_thread.h" |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 NetworkTimeTracker::UpdateCallback | 121 NetworkTimeTracker::UpdateCallback |
122 NetworkTimeTracker::BuildNotifierUpdateCallback() { | 122 NetworkTimeTracker::BuildNotifierUpdateCallback() { |
123 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 123 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
124 return base::Bind(&UpdateNetworkNotifier, | 124 return base::Bind(&UpdateNetworkNotifier, |
125 g_browser_process->io_thread()); | 125 g_browser_process->io_thread()); |
126 } | 126 } |
127 | 127 |
128 net::NetworkTimeNotifier::ObserverCallback | 128 net::NetworkTimeNotifier::ObserverCallback |
129 NetworkTimeTracker::BuildObserverCallback() { | 129 NetworkTimeTracker::BuildObserverCallback() { |
130 return base::Bind(&OnNetworkTimeUpdatedOnIOThread, | 130 return base::Bind(&OnNetworkTimeUpdatedOnIOThread, |
131 MessageLoop::current()->message_loop_proxy(), | 131 base::MessageLoop::current()->message_loop_proxy(), |
132 base::Bind(&NetworkTimeTracker::OnNetworkTimeUpdate, | 132 base::Bind(&NetworkTimeTracker::OnNetworkTimeUpdate, |
133 weak_ptr_factory_.GetWeakPtr())); | 133 weak_ptr_factory_.GetWeakPtr())); |
134 } | 134 } |
135 | 135 |
136 void NetworkTimeTracker::OnNetworkTimeUpdate( | 136 void NetworkTimeTracker::OnNetworkTimeUpdate( |
137 const base::Time& network_time, | 137 const base::Time& network_time, |
138 const base::TimeTicks& network_time_ticks, | 138 const base::TimeTicks& network_time_ticks, |
139 const base::TimeDelta& network_time_uncertainty) { | 139 const base::TimeDelta& network_time_uncertainty) { |
140 DCHECK(thread_checker_.CalledOnValidThread()); | 140 DCHECK(thread_checker_.CalledOnValidThread()); |
141 network_time_ = network_time; | 141 network_time_ = network_time; |
142 network_time_ticks_ = network_time_ticks; | 142 network_time_ticks_ = network_time_ticks; |
143 network_time_uncertainty_ = network_time_uncertainty; | 143 network_time_uncertainty_ = network_time_uncertainty; |
144 } | 144 } |
145 | 145 |
OLD | NEW |