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

Unified Diff: chromeos/network/network_configuration_handler.cc

Issue 243103004: Don't treat Shill ClearProperty errors as failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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 | « chromeos/network/network_configuration_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_configuration_handler.cc
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc
index ea81a75cc398d43fbc3113a2003d8226291c6d1c..9b2efc9231cecb59dff689dc1c41cba927a9bc04 100644
--- a/chromeos/network/network_configuration_handler.cc
+++ b/chromeos/network/network_configuration_handler.cc
@@ -256,7 +256,7 @@ void NetworkConfigurationHandler::ClearProperties(
dbus::ObjectPath(service_path),
names,
base::Bind(&NetworkConfigurationHandler::ClearPropertiesSuccessCallback,
- AsWeakPtr(), service_path, names, callback, error_callback),
+ AsWeakPtr(), service_path, names, callback),
base::Bind(&NetworkConfigurationHandler::ClearPropertiesErrorCallback,
AsWeakPtr(), service_path, error_callback));
}
@@ -394,37 +394,23 @@ void NetworkConfigurationHandler::ClearPropertiesSuccessCallback(
const std::string& service_path,
const std::vector<std::string>& names,
const base::Closure& callback,
- const network_handler::ErrorCallback& error_callback,
const base::ListValue& result) {
const std::string kClearPropertiesFailedError("Error.ClearPropertiesFailed");
DCHECK(names.size() == result.GetSize())
<< "Incorrect result size from ClearProperties.";
- bool some_failed = false;
for (size_t i = 0; i < result.GetSize(); ++i) {
bool success = false;
result.GetBoolean(i, &success);
if (!success) {
+ // If a property was cleared that has never been set, the clear will fail.
+ // We do not track which properties have been set, so just log the error.
NET_LOG_ERROR("ClearProperties Failed: " + names[i], service_path);
- some_failed = true;
}
}
- if (some_failed) {
- if (!error_callback.is_null()) {
- scoped_ptr<base::DictionaryValue> error_data(
- network_handler::CreateErrorData(
- service_path, kClearPropertiesFailedError,
- base::StringPrintf("Errors: %" PRIuS, result.GetSize())));
- error_data->Set("errors", result.DeepCopy());
- scoped_ptr<base::ListValue> name_list(new base::ListValue);
- name_list->AppendStrings(names);
- error_data->Set("names", name_list.release());
- error_callback.Run(kClearPropertiesFailedError, error_data.Pass());
- }
- } else if (!callback.is_null()) {
+ if (!callback.is_null())
callback.Run();
- }
network_state_handler_->RequestUpdateForNetwork(service_path);
}
« no previous file with comments | « chromeos/network/network_configuration_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698