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

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

Issue 7861013: Fix the false-positive detection of commit errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another attempt at detecting errors Created 9 years, 2 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
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 c9b4af4410e11d705c4046005b2b9dd6aec003de..556d872088b4e7a2e48a649d69f9f4e3c0591d94 100644
--- a/chrome/browser/sync/engine/post_commit_message_command.cc
+++ b/chrome/browser/sync/engine/post_commit_message_command.cc
@@ -20,16 +20,24 @@ PostCommitMessageCommand::PostCommitMessageCommand() {}
PostCommitMessageCommand::~PostCommitMessageCommand() {}
void PostCommitMessageCommand::ExecuteImpl(sessions::SyncSession* session) {
- if (session->status_controller()->commit_ids().empty())
+ sessions::StatusController* status = session->status_controller();
+ SyncOperationResult result;
+ if (status->commit_ids().empty())
return; // Nothing to commit.
ClientToServerResponse response;
syncable::ScopedDirLookup dir(session->context()->directory_manager(),
session->context()->account_name());
- if (!dir.good())
+ if (!dir.good()) {
+ result.error_type = DIRECTORY_LOOKUP_FAILED;
+ status->set_last_post_commit_result(result);
return;
- sessions::StatusController* status = session->status_controller();
- if (!SyncerProtoUtil::PostClientToServerMessage(status->commit_message(),
- &response, session)) {
+ }
+ result = SyncerProtoUtil::PostClientToServerMessage(status->commit_message(),
+ &response, session);
+ status->set_last_post_commit_result(result);
+ if (result.error_type != OPERATION_SUCCESS) {
+ VLOG(1) << "Post commit message failed with return code: " <<
+ GetSyncErrorTypeString(result.error_type);
// 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
« no previous file with comments | « chrome/browser/sync/engine/download_updates_command.cc ('k') | chrome/browser/sync/engine/sync_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698