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

Unified Diff: chromeos/network/network_state_handler.cc

Issue 14188057: Add some additional network debugging code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Less state spam Created 7 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
« no previous file with comments | « ash/system/chromeos/network/tray_network.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state_handler.cc
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc
index 863e20f75ee5109ad4c2d2504341dc4861e31a0a..a1909a4f485fa7273aa77bafae0e973ea2af98d8 100644
--- a/chromeos/network/network_state_handler.cc
+++ b/chromeos/network/network_state_handler.cc
@@ -71,6 +71,13 @@ std::string ValueAsString(const base::Value& value) {
return "";
}
+bool ConnectionStateChanged(chromeos::NetworkState* network,
+ const std::string& prev_connection_state) {
+ return (network->connection_state() != prev_connection_state) &&
+ (network->connection_state() != flimflam::kStateIdle ||
+ !prev_connection_state.empty());
+}
+
} // namespace
namespace chromeos {
@@ -408,7 +415,7 @@ void NetworkStateHandler::UpdateManagedStateProperties(
NetworkState* network = managed->AsNetworkState();
DCHECK(network);
// Signal connection state changed after all properties have been updated.
- if (network->connection_state() != prev_connection_state)
+ if (ConnectionStateChanged(network, prev_connection_state))
OnNetworkConnectionStateChanged(network);
NetworkPropertiesUpdated(network);
}
@@ -425,21 +432,22 @@ void NetworkStateHandler::UpdateNetworkServiceProperty(
if (!network->PropertyChanged(key, value))
return;
- std::string detail = network->name() + "." + key;
- std::string vstr = ValueAsString(value);
- if (!vstr.empty())
- detail += " = " + vstr;
- network_event_log::AddEntry(kLogModule, "NetworkPropertyUpdated", detail);
-
- if (network->connection_state() != prev_connection_state) {
- OnNetworkConnectionStateChanged(network);
- } else if (network->path() == default_network_path_ &&
- key != flimflam::kSignalStrengthProperty) {
- // WiFi signal strength updates are too noisy, so don't
- // trigger default network updates for those changes.
- OnDefaultNetworkChanged();
+ if (key == flimflam::kStateProperty) {
+ if (ConnectionStateChanged(network, prev_connection_state))
+ OnNetworkConnectionStateChanged(network);
+ } else {
+ if (network->path() == default_network_path_ &&
+ key != flimflam::kSignalStrengthProperty) {
+ // WiFi signal strength updates are too noisy, so don't
+ // trigger default network updates for those changes.
+ OnDefaultNetworkChanged();
+ }
+ std::string detail = network->name() + "." + key;
+ std::string vstr = ValueAsString(value);
+ if (!vstr.empty())
+ detail += " = " + vstr;
+ network_event_log::AddEntry(kLogModule, "NetworkPropertyUpdated", detail);
}
-
NetworkPropertiesUpdated(network);
}
« no previous file with comments | « ash/system/chromeos/network/tray_network.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698