| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // Enable EDNS0 extensions. | 61 // Enable EDNS0 extensions. |
| 62 bool edns0; | 62 bool edns0; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 | 65 |
| 66 // Service for watching when the system DNS settings have changed. | 66 // Service for watching when the system DNS settings have changed. |
| 67 // Depending on the platform, watches files in /etc/ or Windows registry. | 67 // Depending on the platform, watches files in /etc/ or Windows registry. |
| 68 class NET_EXPORT_PRIVATE DnsConfigService | 68 class NET_EXPORT_PRIVATE DnsConfigService |
| 69 : NON_EXPORTED_BASE(public base::NonThreadSafe) { | 69 : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 70 public: | 70 public: |
| 71 // Callback interface for the client. The observer is called on the same | 71 // Callback interface for the client, called on the same thread as Watch(). |
| 72 // thread as Watch(). Observer must outlive the service. | |
| 73 typedef base::Callback<void(const DnsConfig& config)> CallbackType; | 72 typedef base::Callback<void(const DnsConfig& config)> CallbackType; |
| 74 | 73 |
| 75 // Creates the platform-specific DnsConfigService. | 74 // Creates the platform-specific DnsConfigService. |
| 76 static scoped_ptr<DnsConfigService> CreateSystemService(); | 75 static scoped_ptr<DnsConfigService> CreateSystemService(); |
| 77 | 76 |
| 78 DnsConfigService(); | 77 DnsConfigService(); |
| 79 virtual ~DnsConfigService(); | 78 virtual ~DnsConfigService(); |
| 80 | 79 |
| 81 // Immediately starts watching system configuration for changes and attempts | 80 // Immediately starts watching system configuration for changes and attempts |
| 82 // to read the configuration. For some platform implementations, the current | 81 // to read the configuration. For some platform implementations, the current |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 base::OneShotTimer<DnsConfigService> timer_; | 120 base::OneShotTimer<DnsConfigService> timer_; |
| 122 | 121 |
| 123 private: | 122 private: |
| 124 DISALLOW_COPY_AND_ASSIGN(DnsConfigService); | 123 DISALLOW_COPY_AND_ASSIGN(DnsConfigService); |
| 125 }; | 124 }; |
| 126 | 125 |
| 127 | 126 |
| 128 } // namespace net | 127 } // namespace net |
| 129 | 128 |
| 130 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ | 129 #endif // NET_DNS_DNS_CONFIG_SERVICE_H_ |
| OLD | NEW |