Chromium Code Reviews| Index: chromeos/network/network_configuration_handler.cc |
| diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc |
| index 79ad45d3be24ecafd171423986556ff1f4284c46..0db1260bbfe75a467ee5f4de29edfa43bb776284 100644 |
| --- a/chromeos/network/network_configuration_handler.cc |
| +++ b/chromeos/network/network_configuration_handler.cc |
| @@ -21,6 +21,7 @@ |
| #include "chromeos/dbus/shill_profile_client.h" |
| #include "chromeos/dbus/shill_service_client.h" |
| #include "chromeos/network/network_event_log.h" |
| +#include "chromeos/network/network_state.h" |
| #include "chromeos/network/network_state_handler.h" |
| #include "chromeos/network/shill_property_util.h" |
| #include "dbus/object_path.h" |
| @@ -303,11 +304,20 @@ void NetworkConfigurationHandler::RemoveConfiguration( |
| const network_handler::ErrorCallback& error_callback) { |
| // Service.Remove is not reliable. Instead, request the profile entries |
| // for the service and remove each entry. |
| - if (ContainsKey(profile_entry_deleters_,service_path)) { |
| + if (ContainsKey(profile_entry_deleters_, service_path)) { |
| InvokeErrorCallback( |
| service_path, error_callback, "RemoveConfigurationInProgress"); |
| return; |
| } |
| + const NetworkState* network = network_state_handler_->GetNetworkState( |
| + service_path); |
| + std::string type = network ? network->type() : ""; |
| + if (type.empty() || (type != shill::kTypeWifi && type != shill::kTypeWimax && |
| + type != shill::kTypeVPN)) { |
| + InvokeErrorCallback( |
|
pneubeck (no reviews)
2014/07/07 09:14:26
Why is that restriction necessary?
I guess this i
stevenjb
2014/07/07 23:40:21
This is intended to enforce Shill behavior, i.e. d
pneubeck (no reviews)
2014/07/08 07:55:27
AFAIK, it's not an error to remove the ProfileEntr
stevenjb
2014/07/08 17:13:04
This restriction is inherited from early days of F
|
| + service_path, error_callback, "UnsupportedRemoveType"); |
| + } |
| + |
| NET_LOG_USER("Remove Configuration", service_path); |
| ProfileEntryDeleter* deleter = |
| new ProfileEntryDeleter(this, service_path, callback, error_callback); |