OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 NET_DNS_DNS_CONFIG_SERVICE_H_ | 5 #ifndef NET_DNS_DNS_CONFIG_SERVICE_H_ |
6 #define NET_DNS_DNS_CONFIG_SERVICE_H_ | 6 #define NET_DNS_DNS_CONFIG_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 void StartTimer(); | 120 void StartTimer(); |
121 // Called when the timer expires. | 121 // Called when the timer expires. |
122 void OnTimeout(); | 122 void OnTimeout(); |
123 // Called when the config becomes complete. | 123 // Called when the config becomes complete. |
124 void OnCompleteConfig(); | 124 void OnCompleteConfig(); |
125 | 125 |
126 CallbackType callback_; | 126 CallbackType callback_; |
127 | 127 |
128 DnsConfig dns_config_; | 128 DnsConfig dns_config_; |
129 | 129 |
130 // True after the first valid DnsConfig is received. Temporary, used | |
131 // to detect DNS-changer: http://crbug.com/125599 | |
132 bool checked_rogue_dns_; | |
133 // True after On*Read, before Invalidate*. Tells if the config is complete. | 130 // True after On*Read, before Invalidate*. Tells if the config is complete. |
134 bool have_config_; | 131 bool have_config_; |
135 bool have_hosts_; | 132 bool have_hosts_; |
136 // True if receiver needs to be updated when the config becomes complete. | 133 // True if receiver needs to be updated when the config becomes complete. |
137 bool need_update_; | 134 bool need_update_; |
138 // True if the last config sent was empty (instead of |dns_config_|). | 135 // True if the last config sent was empty (instead of |dns_config_|). |
139 // Set when |timer_| expires. | 136 // Set when |timer_| expires. |
140 bool last_sent_empty_; | 137 bool last_sent_empty_; |
141 | 138 |
142 // Initialized and updated on Invalidate* call. | 139 // Initialized and updated on Invalidate* call. |
143 base::TimeTicks last_invalidate_config_time_; | 140 base::TimeTicks last_invalidate_config_time_; |
144 base::TimeTicks last_invalidate_hosts_time_; | 141 base::TimeTicks last_invalidate_hosts_time_; |
145 // Initialized and updated when |timer_| expires. | 142 // Initialized and updated when |timer_| expires. |
146 base::TimeTicks last_sent_empty_time_; | 143 base::TimeTicks last_sent_empty_time_; |
147 | 144 |
148 // Started in Invalidate*, cleared in On*Read. | 145 // Started in Invalidate*, cleared in On*Read. |
149 base::OneShotTimer<DnsConfigService> timer_; | 146 base::OneShotTimer<DnsConfigService> timer_; |
150 | 147 |
151 DISALLOW_COPY_AND_ASSIGN(DnsConfigService); | 148 DISALLOW_COPY_AND_ASSIGN(DnsConfigService); |
152 }; | 149 }; |
153 | 150 |
154 } // namespace net | 151 } // namespace net |
155 | 152 |
156 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ | 153 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ |
OLD | NEW |