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

Unified Diff: net/base/network_change_notifier.cc

Issue 1306653003: Add connection type to NCN::MaxBandwidthChanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 5 years, 3 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/base/network_change_notifier.cc
diff --git a/net/base/network_change_notifier.cc b/net/base/network_change_notifier.cc
index 03502f6dbfd6a21daef19127e08348013198660d..c8d2f76f2e066de4883d5c71e4eda96599376e4f 100644
--- a/net/base/network_change_notifier.cc
+++ b/net/base/network_change_notifier.cc
@@ -792,6 +792,15 @@ void NetworkChangeNotifier::NotifyObserversOfInitialDNSConfigReadForTests() {
}
// static
+void NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChangeForTests(
+ ConnectionType type,
+ double max_bandwidth) {
+ if (g_network_change_notifier)
+ g_network_change_notifier->NotifyObserversOfMaxBandwidthChangeImpl(
+ type, max_bandwidth);
+}
+
+// static
void NetworkChangeNotifier::SetTestNotificationsOnly(bool test_only) {
DCHECK(!g_network_change_notifier);
NetworkChangeNotifier::test_notifications_only_ = test_only;
@@ -942,11 +951,12 @@ void NetworkChangeNotifier::NotifyObserversOfNetworkChange(
// static
void NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChange(
+ ConnectionType type,
double max_bandwidth_mbps) {
if (g_network_change_notifier &&
!NetworkChangeNotifier::test_notifications_only_) {
g_network_change_notifier->NotifyObserversOfMaxBandwidthChangeImpl(
- max_bandwidth_mbps);
+ type, max_bandwidth_mbps);
}
}
@@ -1015,9 +1025,10 @@ void NetworkChangeNotifier::NotifyObserversOfInitialDNSConfigReadImpl() {
}
void NetworkChangeNotifier::NotifyObserversOfMaxBandwidthChangeImpl(
+ ConnectionType type,
double max_bandwidth_mbps) {
max_bandwidth_observer_list_->Notify(
- FROM_HERE, &MaxBandwidthObserver::OnMaxBandwidthChanged,
+ FROM_HERE, &MaxBandwidthObserver::OnMaxBandwidthChanged, type,
max_bandwidth_mbps);
}

Powered by Google App Engine
This is Rietveld 408576698