Index: chrome/browser/sync/engine/clear_data_command.cc |
diff --git a/chrome/browser/sync/engine/clear_data_command.cc b/chrome/browser/sync/engine/clear_data_command.cc |
index 6e609ed8ca5cd11f156486e3509ea067e2bd19e1..c8859fc53eb27d4dce889e00ee7cd48d0946a6ba 100644 |
--- a/chrome/browser/sync/engine/clear_data_command.cc |
+++ b/chrome/browser/sync/engine/clear_data_command.cc |
@@ -27,8 +27,10 @@ ClearDataCommand::ClearDataCommand() {} |
ClearDataCommand::~ClearDataCommand() {} |
void ClearDataCommand::ExecuteImpl(SyncSession* session) { |
+ StatusController* status = session->status_controller(); |
ClientToServerMessage client_to_server_message; |
ClientToServerResponse client_to_server_response; |
+ SyncOperationResult result; |
client_to_server_message.set_share(session->context()->account_name()); |
client_to_server_message.set_message_contents( |
@@ -40,6 +42,8 @@ void ClearDataCommand::ExecuteImpl(SyncSession* session) { |
session->context()->account_name()); |
if (!dir.good()) { |
LOG(ERROR) << "Scoped dir lookup failed!"; |
+ result.error_type = DIRECTORY_LOOKUP_FAILED; |
+ status->set_last_clear_data_result(result); |
return; |
} |
@@ -47,16 +51,22 @@ void ClearDataCommand::ExecuteImpl(SyncSession* session) { |
VLOG(1) << "Clearing server data"; |
- bool ok = SyncerProtoUtil::PostClientToServerMessage( |
- client_to_server_message, |
- &client_to_server_response, |
- session); |
+ result = SyncerProtoUtil::PostClientToServerMessage( |
+ client_to_server_message, |
+ &client_to_server_response, |
+ session); |
+ status->set_last_clear_data_result(result); |
DVLOG(1) << SyncerProtoUtil::ClientToServerResponseDebugString( |
client_to_server_response); |
- // Clear pending indicates that the server has received our clear message |
- if (!ok || !client_to_server_response.has_error_code() || |
+ // NOTE: This code is broken. error_code() is deprecated. Fixing this |
+ // is a separate issue that I don't want to get into. |
+ |
+ // Clear pending indicates that the server has received our clear message. |
+ if (result.error_type != OPERATION_SUCCESS || |
+ // TODO(rlarocque): This code depends on deprecated error variables. |
+ !client_to_server_response.has_error_code() || |
client_to_server_response.error_code() != |
sync_pb::ClientToServerResponse::SUCCESS) { |
// On failure, subsequent requests to the server will cause it to attempt |