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

Side by Side Diff: net/dns/dns_config_service_win.cc

Issue 11620007: Switch from OnIPAddressChanged and OnConnectionTypeChange to OnNetworkChanged Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "net/dns/dns_config_service_win.h" 5 #include "net/dns/dns_config_service_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 dnscache_watcher_.Watch(kDnscachePath, callback); 529 dnscache_watcher_.Watch(kDnscachePath, callback);
530 policy_watcher_.Watch(kPolicyPath, callback); 530 policy_watcher_.Watch(kPolicyPath, callback);
531 531
532 if (!hosts_watcher_.Watch(GetHostsPath(), false, 532 if (!hosts_watcher_.Watch(GetHostsPath(), false,
533 base::Bind(&Watcher::OnHostsChanged, 533 base::Bind(&Watcher::OnHostsChanged,
534 base::Unretained(this)))) { 534 base::Unretained(this)))) {
535 LOG(ERROR) << "DNS hosts watch failed to start."; 535 LOG(ERROR) << "DNS hosts watch failed to start.";
536 success = false; 536 success = false;
537 } else { 537 } else {
538 // Also need to observe changes to local non-loopback IP for DnsHosts. 538 // Also need to observe changes to local non-loopback IP for DnsHosts.
539 NetworkChangeNotifier::AddIPAddressObserver(this); 539 NetworkChangeNotifier::Deprecated::AddIPAddressObserver(this);
540 } 540 }
541 return success; 541 return success;
542 } 542 }
543 543
544 private: 544 private:
545 void OnHostsChanged(const FilePath& path, bool error) { 545 void OnHostsChanged(const FilePath& path, bool error) {
546 if (error) 546 if (error)
547 NetworkChangeNotifier::RemoveIPAddressObserver(this); 547 NetworkChangeNotifier::RemoveIPAddressObserver(this);
548 service_->OnHostsChanged(!error); 548 service_->OnHostsChanged(!error);
549 } 549 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 } 696 }
697 697
698 } // namespace internal 698 } // namespace internal
699 699
700 // static 700 // static
701 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() { 701 scoped_ptr<DnsConfigService> DnsConfigService::CreateSystemService() {
702 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin()); 702 return scoped_ptr<DnsConfigService>(new internal::DnsConfigServiceWin());
703 } 703 }
704 704
705 } // namespace net 705 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698