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

Unified Diff: net/base/network_change_notifier_win.cc

Issue 10873018: [net] Move DnsConfigService to NetworkChangeNotifier. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add comment Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/network_change_notifier_win.h ('k') | net/dns/dns_config_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/network_change_notifier_win.cc
diff --git a/net/base/network_change_notifier_win.cc b/net/base/network_change_notifier_win.cc
index e5512be366b67e14d59246061dec3b8c3290c4d9..5fefd7fc692a577fe96f00c4bc6a0ee22c380d88 100644
--- a/net/base/network_change_notifier_win.cc
+++ b/net/base/network_change_notifier_win.cc
@@ -13,7 +13,7 @@
#include "base/threading/thread.h"
#include "base/time.h"
#include "net/base/winsock_init.h"
-#include "net/dns/dns_config_watcher.h"
+#include "net/dns/dns_config_service.h"
#pragma comment(lib, "iphlpapi.lib")
@@ -26,38 +26,39 @@ const int kWatchForAddressChangeRetryIntervalMs = 500;
} // namespace
-// Thread on which we can run DnsConfigWatcher, which requires AssertIOAllowed
+// Thread on which we can run DnsConfigService, which requires AssertIOAllowed
// to open registry keys and to handle FilePathWatcher updates.
-class NetworkChangeNotifierWin::DnsWatcherThread : public base::Thread {
+class NetworkChangeNotifierWin::DnsConfigServiceThread : public base::Thread {
public:
- DnsWatcherThread() : base::Thread("DnsWatcher") {}
+ DnsConfigServiceThread() : base::Thread("DnsConfigService") {}
- virtual ~DnsWatcherThread() {
+ virtual ~DnsConfigServiceThread() {
Stop();
}
virtual void Init() OVERRIDE {
- watcher_.Init();
+ service_ = DnsConfigService::CreateSystemService();
+ service_->WatchConfig(base::Bind(&NetworkChangeNotifier::SetDnsConfig));
}
virtual void CleanUp() OVERRIDE {
- watcher_.CleanUp();
+ service_.reset();
}
private:
- internal::DnsConfigWatcher watcher_;
+ scoped_ptr<DnsConfigService> service_;
- DISALLOW_COPY_AND_ASSIGN(DnsWatcherThread);
+ DISALLOW_COPY_AND_ASSIGN(DnsConfigServiceThread);
};
NetworkChangeNotifierWin::NetworkChangeNotifierWin()
: is_watching_(false),
sequential_failures_(0),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)),
- dns_watcher_thread_(new DnsWatcherThread()) {
+ dns_config_service_thread_(new DnsConfigServiceThread()) {
memset(&addr_overlapped_, 0, sizeof addr_overlapped_);
addr_overlapped_.hEvent = WSACreateEvent();
- dns_watcher_thread_->StartWithOptions(
+ dns_config_service_thread_->StartWithOptions(
base::Thread::Options(MessageLoop::TYPE_IO, 0));
}
« no previous file with comments | « net/base/network_change_notifier_win.h ('k') | net/dns/dns_config_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698