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

Unified Diff: sync/engine/process_commit_response_command.cc

Issue 10523003: Refactor following sync commit loop change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another rebase Created 8 years, 6 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 | « sync/engine/process_commit_response_command.h ('k') | sync/engine/syncer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/process_commit_response_command.cc
diff --git a/sync/engine/process_commit_response_command.cc b/sync/engine/process_commit_response_command.cc
index 6514bc13f5cb6a462be997c3efb5ce5cf329bfa3..dfecd39ef9b4141fcd3cc6316635b76f2ca7071d 100644
--- a/sync/engine/process_commit_response_command.cc
+++ b/sync/engine/process_commit_response_command.cc
@@ -74,33 +74,6 @@ std::set<ModelSafeGroup> ProcessCommitResponseCommand::GetGroupsToChange(
return groups_with_commits;
}
-SyncerError ProcessCommitResponseCommand::ModelNeutralExecuteImpl(
- SyncSession* session) {
- syncable::Directory* dir = session->context()->directory();
- const vector<syncable::Id>& commit_ids = commit_set_.GetAllCommitIds();
-
- if (!commit_response_.has_commit()) {
- LOG(WARNING) << "Commit response has no commit body!";
- ClearSyncingBits(dir, commit_ids);
- return SERVER_RESPONSE_VALIDATION_FAILED;
- }
-
- const CommitResponse& cr = commit_response_.commit();
- int commit_count = commit_set_.Size();
- if (cr.entryresponse_size() != commit_count) {
- LOG(ERROR) << "Commit response has wrong number of entries! Expected:" <<
- commit_count << " Got:" << cr.entryresponse_size();
- for (int i = 0 ; i < cr.entryresponse_size() ; i++) {
- LOG(ERROR) << "Response #" << i << " Value: " <<
- cr.entryresponse(i).response_type();
- if (cr.entryresponse(i).has_error_message())
- LOG(ERROR) << " " << cr.entryresponse(i).error_message();
- }
- ClearSyncingBits(dir, commit_ids);
- return SERVER_RESPONSE_VALIDATION_FAILED;
- }
- return SYNCER_OK;
-}
SyncerError ProcessCommitResponseCommand::ModelChangingExecuteImpl(
SyncSession* session) {
@@ -500,22 +473,4 @@ void ProcessCommitResponseCommand::ProcessSuccessfulCommitResponse(
}
}
-void ProcessCommitResponseCommand::ClearSyncingBits(
- syncable::Directory *dir,
- const vector<syncable::Id>& commit_ids) {
- // This is part of the cleanup in the case of a failed commit. Normally we
- // would unset the SYNCING bit when processing the commit response. In the
- // failure case we don't process the response, so we need to clear those bits
- // here.
- syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir);
- for (size_t i = 0; i < commit_ids.size(); i++) {
- syncable::MutableEntry entry(&trans, syncable::GET_BY_ID, commit_ids[i]);
- if (entry.good()) {
- entry.Put(syncable::SYNCING, false);
- } else {
- LOG(WARNING) << "Id: " << commit_ids[i] << " disappeared";
- }
- }
-}
-
} // namespace browser_sync
« no previous file with comments | « sync/engine/process_commit_response_command.h ('k') | sync/engine/syncer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698