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

Side by Side 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 unified diff | Download patch
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 "chromeos/network/network_state_handler.h" 5 #include "chromeos/network/network_state_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 } else { 617 } else {
618 managed_list->push_back(std::move(found->second)); 618 managed_list->push_back(std::move(found->second));
619 managed_map.erase(found); 619 managed_map.erase(found);
620 } 620 }
621 list_entries.insert(path); 621 list_entries.insert(path);
622 } 622 }
623 623
624 if (type != ManagedState::ManagedType::MANAGED_TYPE_NETWORK) 624 if (type != ManagedState::ManagedType::MANAGED_TYPE_NETWORK)
625 return; 625 return;
626 626
627 // Remove associations Tether NetworkStates had with now removed Wi-Fi 627 // If a Wi-Fi NetworkState was removed, also remove its associated
628 // NetworkStates. 628 // TetherNetworkState (if it has one).
629 for (auto& iter : managed_map) { 629 for (auto& iter : managed_map) {
630 if (!iter.second->Matches(NetworkTypePattern::WiFi())) 630 if (iter.second->Matches(NetworkTypePattern::WiFi())) {
631 continue; 631 std::string tether_network_guid =
632 632 iter.second->AsNetworkState()->tether_guid();
633 NetworkState* tether_network = GetModifiableNetworkStateFromGuid( 633 if (!tether_network_guid.empty())
634 iter.second->AsNetworkState()->tether_guid()); 634 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.
635 if (tether_network) 635 }
636 tether_network->set_tether_guid(std::string());
637 } 636 }
638 } 637 }
639 638
640 void NetworkStateHandler::ProfileListChanged() { 639 void NetworkStateHandler::ProfileListChanged() {
641 NET_LOG_EVENT("ProfileListChanged", "Re-Requesting Network Properties"); 640 NET_LOG_EVENT("ProfileListChanged", "Re-Requesting Network Properties");
642 for (ManagedStateList::iterator iter = network_list_.begin(); 641 for (ManagedStateList::iterator iter = network_list_.begin();
643 iter != network_list_.end(); ++iter) { 642 iter != network_list_.end(); ++iter) {
644 NetworkState* network = (*iter)->AsNetworkState(); 643 NetworkState* network = (*iter)->AsNetworkState();
645 DCHECK(network); 644 DCHECK(network);
646 shill_property_handler_->RequestProperties( 645 shill_property_handler_->RequestProperties(
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 if (type.MatchesType(shill::kTypeBluetooth)) 1167 if (type.MatchesType(shill::kTypeBluetooth))
1169 technologies.emplace_back(shill::kTypeBluetooth); 1168 technologies.emplace_back(shill::kTypeBluetooth);
1170 if (type.MatchesType(shill::kTypeVPN)) 1169 if (type.MatchesType(shill::kTypeVPN))
1171 technologies.emplace_back(shill::kTypeVPN); 1170 technologies.emplace_back(shill::kTypeVPN);
1172 1171
1173 CHECK_GT(technologies.size(), 0ul); 1172 CHECK_GT(technologies.size(), 0ul);
1174 return technologies; 1173 return technologies;
1175 } 1174 }
1176 1175
1177 } // namespace chromeos 1176 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698