diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-25 04:18:49 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-25 04:18:49 +0000 |
commit | 7d0c2e9c4ca32baa00cca2748442fbc840d88acb (patch) | |
tree | f0f9ac4b24e72e80aa038ee97c827654342db849 /chromeos/network/network_configuration_handler.cc | |
parent | 48101a04fb57fe90656bbf80a2c2dcdb57193dd8 (diff) | |
download | chromium_src-7d0c2e9c4ca32baa00cca2748442fbc840d88acb.zip chromium_src-7d0c2e9c4ca32baa00cca2748442fbc840d88acb.tar.gz chromium_src-7d0c2e9c4ca32baa00cca2748442fbc840d88acb.tar.bz2 |
Cleanup network event logging, add to ManagedNetworkConfigurationHandler
I noticed we were getting some ERROR spam when we request properites for
networks that are no longer visible, which required some additiona
logging to track down (and hopefully make it easier to track down other
issues in the future).
BUG=none
TBR=pneubeck@chromium.org
Original CL: https://codereview.chromium.org/207183003/
Review URL: https://codereview.chromium.org/210073007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@259145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/network/network_configuration_handler.cc')
-rw-r--r-- | chromeos/network/network_configuration_handler.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc index 315f7a8..ea81a75 100644 --- a/chromeos/network/network_configuration_handler.cc +++ b/chromeos/network/network_configuration_handler.cc @@ -53,13 +53,6 @@ void GetPropertiesCallback( const std::string& service_path, DBusMethodCallStatus call_status, const base::DictionaryValue& properties) { - // Get the correct name from WifiHex if necessary. - scoped_ptr<base::DictionaryValue> properties_copy(properties.DeepCopy()); - std::string name = - shill_property_util::GetNameFromProperties(service_path, properties); - if (!name.empty()) { - properties_copy->SetStringWithoutPathExpansion(shill::kNameProperty, name); - } if (call_status != DBUS_METHOD_CALL_SUCCESS) { // Because network services are added and removed frequently, we will see // failures regularly, so don't log these. @@ -67,9 +60,18 @@ void GetPropertiesCallback( service_path, network_handler::kDBusFailedError, network_handler::kDBusFailedErrorMessage); - } else if (!callback.is_null()) { - callback.Run(service_path, *properties_copy.get()); + return; } + if (callback.is_null()) + return; + + // Get the correct name from WifiHex if necessary. + scoped_ptr<base::DictionaryValue> properties_copy(properties.DeepCopy()); + std::string name = + shill_property_util::GetNameFromProperties(service_path, properties); + if (!name.empty()) + properties_copy->SetStringWithoutPathExpansion(shill::kNameProperty, name); + callback.Run(service_path, *properties_copy.get()); } void SetNetworkProfileErrorCallback( @@ -267,15 +269,17 @@ void NetworkConfigurationHandler::CreateConfiguration( DBusThreadManager::Get()->GetShillManagerClient(); std::string type; properties.GetStringWithoutPathExpansion(shill::kTypeProperty, &type); + DCHECK(!type.empty()); if (NetworkTypePattern::Ethernet().MatchesType(type)) { InvokeErrorCallback( - "" /* no service path */, + shill_property_util::GetNetworkIdFromProperties(properties), error_callback, - "ConfigureServiceForProfile is not implemented for Ethernet"); + "ConfigureServiceForProfile: Invalid type: " + type); return; } - NET_LOG_USER("CreateConfiguration", type); + NET_LOG_USER("CreateConfiguration: " + type, + shill_property_util::GetNetworkIdFromProperties(properties)); LogConfigProperties("Configure", type, properties); std::string profile; |