| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_DNS_DNS_CONFIG_WATCHER_H_ | |
| 6 #define NET_DNS_DNS_CONFIG_WATCHER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 | |
| 11 namespace net { | |
| 12 namespace internal { | |
| 13 | |
| 14 // Watches when the system DNS settings have changed. It is used by | |
| 15 // NetworkChangeNotifier to provide signals to registered DNSObservers. | |
| 16 // Depending on the platform, watches files, Windows registry, or libnotify key. | |
| 17 // If some watches fail, we keep the working parts, but NetworkChangeNotifier | |
| 18 // will mark notifications to DNSObserver with the CHANGE_DNS_WATCH_FAILED bit. | |
| 19 class DnsConfigWatcher { | |
| 20 public: | |
| 21 DnsConfigWatcher(); | |
| 22 ~DnsConfigWatcher(); | |
| 23 | |
| 24 // Starts watching system configuration for changes. The current thread must | |
| 25 // have a MessageLoopForIO. The signals will be delivered directly to | |
| 26 // the global NetworkChangeNotifier. | |
| 27 void Init(); | |
| 28 | |
| 29 // Must be called on the same thread as Init. Required if dtor will be called | |
| 30 // on a different thread. | |
| 31 void CleanUp(); | |
| 32 | |
| 33 private: | |
| 34 // Platform-specific implementation. | |
| 35 class Core; | |
| 36 scoped_ptr<Core> core_; | |
| 37 | |
| 38 DISALLOW_COPY_AND_ASSIGN(DnsConfigWatcher); | |
| 39 }; | |
| 40 | |
| 41 } // namespace internal | |
| 42 } // namespace net | |
| 43 | |
| 44 #endif // NET_DNS_DNS_CONFIG_WATCHER_H_ | |
| OLD | NEW |