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

Unified Diff: chrome/browser/sync/engine/post_commit_message_command.cc

Issue 9695016: Handle errors in posting sync commit messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/post_commit_message_command.cc
diff --git a/chrome/browser/sync/engine/post_commit_message_command.cc b/chrome/browser/sync/engine/post_commit_message_command.cc
index 2df9accf12c166f579a2b0713304117676b9b270..bccd4517a33426a33129e28190228b4b42fa7b6f 100644
--- a/chrome/browser/sync/engine/post_commit_message_command.cc
+++ b/chrome/browser/sync/engine/post_commit_message_command.cc
@@ -25,8 +25,9 @@ SyncerError PostCommitMessageCommand::ExecuteImpl(
ClientToServerResponse response;
syncable::Directory* dir = session->context()->directory();
sessions::StatusController* status = session->mutable_status_controller();
- if (!SyncerProtoUtil::PostClientToServerMessage(status->commit_message(),
- &response, session)) {
+ SyncerError result = SyncerProtoUtil::PostClientToServerMessage(
+ status->commit_message(), &response, session);
+ if (result != SYNCER_OK) {
// None of our changes got through. Clear the SYNCING bit which was
// set to true during BuildCommitCommand, and which may still be true.
// Not to be confused with IS_UNSYNCED, this bit is used to detect local
@@ -37,11 +38,10 @@ SyncerError PostCommitMessageCommand::ExecuteImpl(
syncable::MutableEntry entry(&trans, syncable::GET_BY_ID, commit_ids[i]);
entry.Put(syncable::SYNCING, false);
}
- return SYNCER_OK; // TODO(rlarocque): Return an error here.
- } else {
- status->set_items_committed();
+ return result;
}
+ status->set_items_committed();
status->mutable_commit_response()->CopyFrom(response);
return SYNCER_OK;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698