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

Unified Diff: chromeos/network/shill_property_handler.cc

Issue 275543005: Use GUID instead of ServicePath in networkingPrivate API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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
« no previous file with comments | « chromeos/network/network_util.cc ('k') | components/wifi/fake_wifi_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/shill_property_handler.cc
diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc
index 13f34c1072515595caa02f25e9296d97f1ea9067..219da5521abd8902d0e6bbea31576b8e583506e8 100644
--- a/chromeos/network/shill_property_handler.cc
+++ b/chromeos/network/shill_property_handler.cc
@@ -353,9 +353,15 @@ void ShillPropertyHandler::UpdateProperties(ManagedState::ManagedType type,
(*iter)->GetAsString(&path);
if (path.empty())
continue;
+ // Only request properties once. Favorites that are visible will be updated
+ // when the Network entry is updated. Since 'Services' is always processed
+ // before ServiceCompleteList, only Favorites that are not visible will be
+ // requested here, and GetPropertiesCallback() will only get called with
+ // type == FAVORITE for non-visible Favorites.
if (type == ManagedState::MANAGED_TYPE_FAVORITE &&
- requested_service_updates.count(path) > 0)
- continue; // Update already requested
+ requested_service_updates.count(path) > 0) {
+ continue;
+ }
// We add a special case for devices here to work around an issue in shill
// that prevents it from sending property changed signals for cellular
@@ -477,16 +483,13 @@ void ShillPropertyHandler::GetPropertiesCallback(
base::StringPrintf("%s: %d", path.c_str(), call_status));
return;
}
- // Update Favorite properties for networks in the Services list.
+ // Update Favorite properties for networks in the Services list. Call this
+ // for all networks, regardless of whether or not Profile is set, because
+ // we track all networks in the Favorites list (even if they aren't saved
+ // in a Profile). See notes in UpdateProperties() and favorite_state.h.
if (type == ManagedState::MANAGED_TYPE_NETWORK) {
- // Only networks with a ProfilePath set are Favorites.
- std::string profile_path;
- properties.GetStringWithoutPathExpansion(
- shill::kProfileProperty, &profile_path);
- if (!profile_path.empty()) {
- listener_->UpdateManagedStateProperties(
- ManagedState::MANAGED_TYPE_FAVORITE, path, properties);
- }
+ listener_->UpdateManagedStateProperties(
+ ManagedState::MANAGED_TYPE_FAVORITE, path, properties);
}
listener_->UpdateManagedStateProperties(type, path, properties);
« no previous file with comments | « chromeos/network/network_util.cc ('k') | components/wifi/fake_wifi_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698