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

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

Issue 2376693002: Remove call to MessageLoop::QuitWhenIdle() in network_time_tracker.cc. (Closed)
Patch Set: self-review Created 4 years, 2 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 | « no previous file | components/network_time/network_time_tracker.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 #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
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
15 #include "base/time/clock.h" 15 #include "base/time/clock.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "base/timer/timer.h" 17 #include "base/timer/timer.h"
18 #include "net/url_request/url_fetcher_delegate.h" 18 #include "net/url_request/url_fetcher_delegate.h"
19 #include "url/gurl.h" 19 #include "url/gurl.h"
20 20
21 class PrefRegistrySimple; 21 class PrefRegistrySimple;
22 class PrefService; 22 class PrefService;
23 23
24 namespace base { 24 namespace base {
25 class MessageLoop; 25 class RunLoop;
26 class TickClock; 26 class TickClock;
27 } // namespace base 27 } // namespace base
28 28
29 namespace client_update_protocol { 29 namespace client_update_protocol {
30 class Ecdsa; 30 class Ecdsa;
31 } // namespace client_update_protocol 31 } // namespace client_update_protocol
32 32
33 namespace net { 33 namespace net {
34 class URLFetcher; 34 class URLFetcher;
35 class URLRequestContextGetter; 35 class URLRequestContextGetter;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 size_t max_response_size_; 137 size_t max_response_size_;
138 base::TimeDelta backoff_; 138 base::TimeDelta backoff_;
139 // Timer that runs CheckTime(). All backoff and delay is implemented by 139 // Timer that runs CheckTime(). All backoff and delay is implemented by
140 // changing the delay of this timer, with the result that CheckTime() may 140 // changing the delay of this timer, with the result that CheckTime() may
141 // assume that if it runs, it is eligible to issue a time query. 141 // assume that if it runs, it is eligible to issue a time query.
142 base::RepeatingTimer timer_; 142 base::RepeatingTimer timer_;
143 scoped_refptr<net::URLRequestContextGetter> getter_; 143 scoped_refptr<net::URLRequestContextGetter> getter_;
144 std::unique_ptr<net::URLFetcher> time_fetcher_; 144 std::unique_ptr<net::URLFetcher> time_fetcher_;
145 base::TimeTicks fetch_started_; 145 base::TimeTicks fetch_started_;
146 std::unique_ptr<client_update_protocol::Ecdsa> query_signer_; 146 std::unique_ptr<client_update_protocol::Ecdsa> query_signer_;
147 base::MessageLoop* loop_; // For testing; quit on fetch complete. 147
148 // Run by WaitForFetchForTesting() and quit by OnURLFetchComplete().
149 base::RunLoop* run_loop_for_testing_ = nullptr;
148 150
149 // The |Clock| and |TickClock| are used to sanity-check one another, allowing 151 // The |Clock| and |TickClock| are used to sanity-check one another, allowing
150 // the NetworkTimeTracker to notice e.g. suspend/resume events and clock 152 // the NetworkTimeTracker to notice e.g. suspend/resume events and clock
151 // resets. 153 // resets.
152 std::unique_ptr<base::Clock> clock_; 154 std::unique_ptr<base::Clock> clock_;
153 std::unique_ptr<base::TickClock> tick_clock_; 155 std::unique_ptr<base::TickClock> tick_clock_;
154 156
155 PrefService* pref_service_; 157 PrefService* pref_service_;
156 158
157 // Network time based on last call to UpdateNetworkTime(). 159 // Network time based on last call to UpdateNetworkTime().
(...skipping 12 matching lines...) Expand all
170 base::TimeDelta network_time_uncertainty_; 172 base::TimeDelta network_time_uncertainty_;
171 173
172 base::ThreadChecker thread_checker_; 174 base::ThreadChecker thread_checker_;
173 175
174 DISALLOW_COPY_AND_ASSIGN(NetworkTimeTracker); 176 DISALLOW_COPY_AND_ASSIGN(NetworkTimeTracker);
175 }; 177 };
176 178
177 } // namespace network_time 179 } // namespace network_time
178 180
179 #endif // COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_ 181 #endif // COMPONENTS_NETWORK_TIME_NETWORK_TIME_TRACKER_H_
OLDNEW
« no previous file with comments | « no previous file | components/network_time/network_time_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698