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

Unified Diff: net/dns/address_sorter_posix.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 side-by-side diff with in-line comments
Download patch
Index: net/dns/address_sorter_posix.cc
diff --git a/net/dns/address_sorter_posix.cc b/net/dns/address_sorter_posix.cc
index 51ef35ef2e37b9282d91d54de09a557080fba109..0b0802264c6c7c6c839258ccd73d85aa966ea01a 100644
--- a/net/dns/address_sorter_posix.cc
+++ b/net/dns/address_sorter_posix.cc
@@ -270,12 +270,12 @@ AddressSorterPosix::AddressSorterPosix(ClientSocketFactory* socket_factory)
arraysize(kDefaultLabelTable))),
ipv4_scope_table_(LoadPolicy(kDefaultIPv4ScopeTable,
arraysize(kDefaultIPv4ScopeTable))) {
- NetworkChangeNotifier::AddIPAddressObserver(this);
- OnIPAddressChanged();
+ NetworkChangeNotifier::AddNetworkChangeObserver(this);
+ OnNetworkChanged(NetworkChangeNotifier::CONNECTION_NONE);
}
AddressSorterPosix::~AddressSorterPosix() {
- NetworkChangeNotifier::RemoveIPAddressObserver(this);
+ NetworkChangeNotifier::RemoveNetworkChangeObserver(this);
}
void AddressSorterPosix::Sort(const AddressList& list,
@@ -340,8 +340,11 @@ void AddressSorterPosix::Sort(const AddressList& list,
callback.Run(true, result);
}
-void AddressSorterPosix::OnIPAddressChanged() {
+void AddressSorterPosix::OnNetworkChanged(
+ NetworkChangeNotifier::ConnectionType type) {
DCHECK(CalledOnValidThread());
+ if (type != NetworkChangeNotifier::CONNECTION_NONE)
szym 2013/01/20 06:52:08 I suggest a comment: // Update the map on the "des
+ return;
source_map_.clear();
#if defined(OS_LINUX)
const internal::AddressTrackerLinux* tracker =

Powered by Google App Engine
This is Rietveld 408576698