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

Unified Diff: chromeos/network/network_state_handler.cc

Issue 2821103003: Remove the configuration of Tether-associated Wi-Fi networks once connectivity is lost. (Closed)
Patch Set: Created 3 years, 8 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: chromeos/network/network_state_handler.cc
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index aeba782ca751cfe87730c31e6c33375bf4defc5b..40b07001b844735780f313a506eb79dd42db55cf 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -624,16 +624,15 @@ void NetworkStateHandler::UpdateManagedList(ManagedState::ManagedType type,
if (type != ManagedState::ManagedType::MANAGED_TYPE_NETWORK)
return;
- // Remove associations Tether NetworkStates had with now removed Wi-Fi
- // NetworkStates.
+ // If a Wi-Fi NetworkState was removed, also remove its associated
+ // TetherNetworkState (if it has one).
for (auto& iter : managed_map) {
- if (!iter.second->Matches(NetworkTypePattern::WiFi()))
- continue;
-
- NetworkState* tether_network = GetModifiableNetworkStateFromGuid(
- iter.second->AsNetworkState()->tether_guid());
- if (tether_network)
- tether_network->set_tether_guid(std::string());
+ if (iter.second->Matches(NetworkTypePattern::WiFi())) {
+ std::string tether_network_guid =
+ iter.second->AsNetworkState()->tether_guid();
+ if (!tether_network_guid.empty())
+ RemoveTetherNetworkState(tether_network_guid);
Kyle Horimoto 2017/04/17 20:34:53 I don't think this should be a responsibility of N
stevenjb 2017/04/18 21:03:36 +1. That allows the Tether code to make the decisi
Ryan Hansberry 2017/04/20 20:57:58 Done.
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698