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 #include "net/base/network_change_notifier.h" | 5 #include "net/base/network_change_notifier.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
916 } | 916 } |
917 | 917 |
918 // static | 918 // static |
919 void NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests( | 919 void NetworkChangeNotifier::NotifyObserversOfNetworkChangeForTests( |
920 ConnectionType type) { | 920 ConnectionType type) { |
921 if (g_network_change_notifier) | 921 if (g_network_change_notifier) |
922 g_network_change_notifier->NotifyObserversOfNetworkChangeImpl(type); | 922 g_network_change_notifier->NotifyObserversOfNetworkChangeImpl(type); |
923 } | 923 } |
924 | 924 |
925 // static | 925 // static |
926 void NetworkChangeNotifier::NotifyObserversOfSpecificNetworkChangeForTests( | |
927 NetworkChangeType type, | |
928 NetworkHandle network) { | |
929 if (g_network_change_notifier) { | |
930 g_network_change_notifier->NotifyObserversOfSpecificNetworkChangeImpl( | |
931 type, network); | |
932 } | |
933 } | |
934 | |
935 // static | |
926 void NetworkChangeNotifier::NotifyObserversOfInitialDNSConfigReadForTests() { | 936 void NetworkChangeNotifier::NotifyObserversOfInitialDNSConfigReadForTests() { |
927 if (g_network_change_notifier) | 937 if (g_network_change_notifier) |
928 g_network_change_notifier->NotifyObserversOfInitialDNSConfigReadImpl(); | 938 g_network_change_notifier->NotifyObserversOfInitialDNSConfigReadImpl(); |
929 } | 939 } |
930 | 940 |
931 // static | 941 // static |
932 void NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChangeForTests( | 942 void NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChangeForTests( |
933 double max_bandwidth_mbps, | 943 double max_bandwidth_mbps, |
934 ConnectionType type) { | 944 ConnectionType type) { |
935 if (g_network_change_notifier) { | 945 if (g_network_change_notifier) { |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1063 !NetworkChangeNotifier::test_notifications_only_) { | 1073 !NetworkChangeNotifier::test_notifications_only_) { |
1064 g_network_change_notifier->NotifyObserversOfInitialDNSConfigReadImpl(); | 1074 g_network_change_notifier->NotifyObserversOfInitialDNSConfigReadImpl(); |
1065 } | 1075 } |
1066 } | 1076 } |
1067 | 1077 |
1068 // static | 1078 // static |
1069 void NetworkChangeNotifier::NotifyObserversOfSpecificNetworkChange( | 1079 void NetworkChangeNotifier::NotifyObserversOfSpecificNetworkChange( |
1070 NetworkChangeType type, | 1080 NetworkChangeType type, |
1071 NetworkHandle network) { | 1081 NetworkHandle network) { |
1072 if (g_network_change_notifier && | 1082 if (g_network_change_notifier && |
1073 !NetworkChangeNotifier::test_notifications_only_) { | 1083 !NetworkChangeNotifier::test_notifications_only_) { |
Ryan Hamilton
2015/12/22 23:12:57
If you can arrange for this variable to be false (
pauljensen
2015/12/29 13:35:41
+1 to Ryan's comment. It should be false in your
| |
1074 g_network_change_notifier->NotifyObserversOfSpecificNetworkChangeImpl( | 1084 g_network_change_notifier->NotifyObserversOfSpecificNetworkChangeImpl( |
1075 type, network); | 1085 type, network); |
1076 } | 1086 } |
1077 } | 1087 } |
1078 | 1088 |
1079 // static | 1089 // static |
1080 void NetworkChangeNotifier::SetDnsConfig(const DnsConfig& config) { | 1090 void NetworkChangeNotifier::SetDnsConfig(const DnsConfig& config) { |
1081 if (!g_network_change_notifier) | 1091 if (!g_network_change_notifier) |
1082 return; | 1092 return; |
1083 g_network_change_notifier->network_state_->SetDnsConfig(config); | 1093 g_network_change_notifier->network_state_->SetDnsConfig(config); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1163 | 1173 |
1164 NetworkChangeNotifier::DisableForTest::~DisableForTest() { | 1174 NetworkChangeNotifier::DisableForTest::~DisableForTest() { |
1165 DCHECK(!g_network_change_notifier); | 1175 DCHECK(!g_network_change_notifier); |
1166 g_network_change_notifier = network_change_notifier_; | 1176 g_network_change_notifier = network_change_notifier_; |
1167 } | 1177 } |
1168 | 1178 |
1169 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { | 1179 void NetworkChangeNotifier::DNSObserver::OnInitialDNSConfigRead() { |
1170 } | 1180 } |
1171 | 1181 |
1172 } // namespace net | 1182 } // namespace net |
OLD | NEW |