OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/sync/engine_impl/directory_commit_contribution.h" | 5 #include "components/sync/engine_impl/directory_commit_contribution.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "components/sync/engine/cycle/commit_counters.h" | 10 #include "components/sync/engine/cycle/commit_counters.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 break; | 114 break; |
115 default: | 115 default: |
116 LOG(FATAL) << "Bad return from ProcessSingleCommitResponse"; | 116 LOG(FATAL) << "Bad return from ProcessSingleCommitResponse"; |
117 } | 117 } |
118 } | 118 } |
119 MarkDeletedChildrenSynced(dir_, &trans, &deleted_folders); | 119 MarkDeletedChildrenSynced(dir_, &trans, &deleted_folders); |
120 } | 120 } |
121 | 121 |
122 CommitCounters* counters = debug_info_emitter_->GetMutableCommitCounters(); | 122 CommitCounters* counters = debug_info_emitter_->GetMutableCommitCounters(); |
123 counters->num_commits_success += successes; | 123 counters->num_commits_success += successes; |
124 counters->num_commits_conflict += transient_error_commits; | 124 counters->num_commits_conflict += conflicting_commits; |
125 counters->num_commits_error += transient_error_commits; | 125 counters->num_commits_error += transient_error_commits; |
126 | 126 |
127 int commit_count = static_cast<int>(metahandles_.size()); | 127 int commit_count = static_cast<int>(metahandles_.size()); |
128 if (commit_count == successes) { | 128 if (commit_count == successes) { |
129 return SYNCER_OK; | 129 return SYNCER_OK; |
130 } else if (error_commits > 0) { | 130 } else if (error_commits > 0) { |
131 return SERVER_RETURN_UNKNOWN_ERROR; | 131 return SERVER_RETURN_UNKNOWN_ERROR; |
132 } else if (transient_error_commits > 0) { | 132 } else if (transient_error_commits > 0) { |
133 return SERVER_RETURN_TRANSIENT_ERROR; | 133 return SERVER_RETURN_TRANSIENT_ERROR; |
134 } else if (conflicting_commits > 0) { | 134 } else if (conflicting_commits > 0) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // complete but the Cleanup method is called anyways. It appears these are | 183 // complete but the Cleanup method is called anyways. It appears these are |
184 // unset on the assumption that the sync cycle must have finished properly, | 184 // unset on the assumption that the sync cycle must have finished properly, |
185 // although that's actually up to the commit response handling logic. | 185 // although that's actually up to the commit response handling logic. |
186 entry.PutDirtySync(false); | 186 entry.PutDirtySync(false); |
187 entry.PutSyncing(false); | 187 entry.PutSyncing(false); |
188 } | 188 } |
189 syncing_bits_set_ = false; | 189 syncing_bits_set_ = false; |
190 } | 190 } |
191 | 191 |
192 } // namespace syncer | 192 } // namespace syncer |
OLD | NEW |