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> |
11 | 11 |
12 #include "base/gtest_prod_util.h" | |
13 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
15 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
16 #include "base/time/time.h" | 15 #include "base/time/time.h" |
17 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
18 // Needed on shared build with MSVS2010 to avoid multiple definitions of | 17 // Needed on shared build with MSVS2010 to avoid multiple definitions of |
19 // std::vector<IPEndPoint>. | 18 // std::vector<IPEndPoint>. |
20 #include "net/base/address_list.h" | 19 #include "net/base/address_list.h" |
21 #include "net/base/ip_endpoint.h" // win requires size of IPEndPoint | 20 #include "net/base/ip_endpoint.h" // win requires size of IPEndPoint |
22 #include "net/base/net_export.h" | 21 #include "net/base/net_export.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 protected: | 149 protected: |
151 enum WatchStatus { | 150 enum WatchStatus { |
152 DNS_CONFIG_WATCH_STARTED = 0, | 151 DNS_CONFIG_WATCH_STARTED = 0, |
153 DNS_CONFIG_WATCH_FAILED_TO_START_CONFIG, | 152 DNS_CONFIG_WATCH_FAILED_TO_START_CONFIG, |
154 DNS_CONFIG_WATCH_FAILED_TO_START_HOSTS, | 153 DNS_CONFIG_WATCH_FAILED_TO_START_HOSTS, |
155 DNS_CONFIG_WATCH_FAILED_CONFIG, | 154 DNS_CONFIG_WATCH_FAILED_CONFIG, |
156 DNS_CONFIG_WATCH_FAILED_HOSTS, | 155 DNS_CONFIG_WATCH_FAILED_HOSTS, |
157 DNS_CONFIG_WATCH_MAX, | 156 DNS_CONFIG_WATCH_MAX, |
158 }; | 157 }; |
159 | 158 |
160 // Immediately attempts to read the current configuration. | 159 // Immediately attempts to read the current configuration. |
161 virtual void ReadNow() = 0; | 160 virtual void ReadNow() = 0; |
162 // Registers system watchers. Returns true iff succeeds. | 161 // Registers system watchers. Returns true iff succeeds. |
163 virtual bool StartWatching() = 0; | 162 virtual bool StartWatching() = 0; |
164 | 163 |
165 // Called when the current config (except hosts) has changed. | 164 // Called when the current config (except hosts) has changed. |
166 void InvalidateConfig(); | 165 void InvalidateConfig(); |
167 // Called when the current hosts have changed. | 166 // Called when the current hosts have changed. |
168 void InvalidateHosts(); | 167 void InvalidateHosts(); |
169 | 168 |
170 // Called with new config. |config|.hosts is ignored. | 169 // Called with new config. |config|.hosts is ignored. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 base::OneShotTimer timer_; | 206 base::OneShotTimer timer_; |
208 | 207 |
209 NameServerClassifier classifier_; | 208 NameServerClassifier classifier_; |
210 | 209 |
211 DISALLOW_COPY_AND_ASSIGN(DnsConfigService); | 210 DISALLOW_COPY_AND_ASSIGN(DnsConfigService); |
212 }; | 211 }; |
213 | 212 |
214 } // namespace net | 213 } // namespace net |
215 | 214 |
216 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ | 215 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ |
OLD | NEW |