summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/network/network_state_handler.cc15
-rw-r--r--chromeos/network/shill_property_handler.cc2
2 files changed, 11 insertions, 6 deletions
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index 64b96a9..ce70f3d 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -138,7 +138,8 @@ void NetworkStateHandler::SetTechnologyEnabled(
const DeviceState* NetworkStateHandler::GetDeviceState(
const std::string& device_path) const {
const DeviceState* device = GetModifiableDeviceState(device_path);
- DCHECK(!device || device->update_received());
+ if (device && !device->update_received())
+ return NULL;
return device;
}
@@ -172,7 +173,8 @@ bool NetworkStateHandler::GetScanningByType(
const NetworkState* NetworkStateHandler::GetNetworkState(
const std::string& service_path) const {
const NetworkState* network = GetModifiableNetworkState(service_path);
- DCHECK(!network || network->update_received());
+ if (network && !network->update_received())
+ return NULL;
return network;
}
@@ -312,7 +314,8 @@ const FavoriteState* NetworkStateHandler::GetFavoriteState(
GetModifiableManagedState(&favorite_list_, service_path);
if (!managed)
return NULL;
- DCHECK(managed->update_received());
+ if (managed && !managed->update_received())
+ return NULL;
return managed->AsFavoriteState();
}
@@ -495,8 +498,9 @@ void NetworkStateHandler::UpdateNetworkServiceProperty(
// Update any associated FavoriteState.
ManagedState* favorite =
GetModifiableManagedState(&favorite_list_, service_path);
+ bool changed = false;
if (favorite)
- favorite->PropertyChanged(key, value);
+ changed |= favorite->PropertyChanged(key, value);
// Update the NetworkState.
NetworkState* network = GetModifiableNetworkState(service_path);
@@ -504,7 +508,8 @@ void NetworkStateHandler::UpdateNetworkServiceProperty(
return;
std::string prev_connection_state = network->connection_state();
std::string prev_profile_path = network->profile_path();
- if (!network->PropertyChanged(key, value))
+ changed |= network->PropertyChanged(key, value);
+ if (!changed)
return;
if (key == shill::kStateProperty) {
diff --git a/chromeos/network/shill_property_handler.cc b/chromeos/network/shill_property_handler.cc
index 4d2604e..71fcb37 100644
--- a/chromeos/network/shill_property_handler.cc
+++ b/chromeos/network/shill_property_handler.cc
@@ -465,7 +465,6 @@ void ShillPropertyHandler::GetPropertiesCallback(
base::StringPrintf("%s: %d", path.c_str(), call_status));
return;
}
- listener_->UpdateManagedStateProperties(type, path, properties);
// Update Favorite properties for networks in the Services list.
if (type == ManagedState::MANAGED_TYPE_NETWORK) {
// Only networks with a ProfilePath set are Favorites.
@@ -477,6 +476,7 @@ void ShillPropertyHandler::GetPropertiesCallback(
ManagedState::MANAGED_TYPE_FAVORITE, path, properties);
}
}
+ listener_->UpdateManagedStateProperties(type, path, properties);
// Request IPConfig parameters for networks.
if (type == ManagedState::MANAGED_TYPE_NETWORK &&
properties.HasKey(shill::kIPConfigProperty)) {