OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/engine/syncer.h" | 5 #include "chrome/browser/sync/engine/syncer.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 next_step = CLEANUP_DISABLED_TYPES; | 137 next_step = CLEANUP_DISABLED_TYPES; |
138 break; | 138 break; |
139 case CLEANUP_DISABLED_TYPES: { | 139 case CLEANUP_DISABLED_TYPES: { |
140 CleanupDisabledTypesCommand cleanup; | 140 CleanupDisabledTypesCommand cleanup; |
141 cleanup.Execute(session); | 141 cleanup.Execute(session); |
142 next_step = DOWNLOAD_UPDATES; | 142 next_step = DOWNLOAD_UPDATES; |
143 break; | 143 break; |
144 } | 144 } |
145 case DOWNLOAD_UPDATES: { | 145 case DOWNLOAD_UPDATES: { |
146 DownloadUpdatesCommand download_updates; | 146 DownloadUpdatesCommand download_updates; |
147 download_updates.Execute(session); | 147 session->mutable_status_controller()->set_last_download_updates_result( |
| 148 download_updates.Execute(session)); |
148 next_step = PROCESS_CLIENT_COMMAND; | 149 next_step = PROCESS_CLIENT_COMMAND; |
149 break; | 150 break; |
150 } | 151 } |
151 case PROCESS_CLIENT_COMMAND: { | 152 case PROCESS_CLIENT_COMMAND: { |
152 ProcessClientCommand(session); | 153 ProcessClientCommand(session); |
153 next_step = VERIFY_UPDATES; | 154 next_step = VERIFY_UPDATES; |
154 break; | 155 break; |
155 } | 156 } |
156 case VERIFY_UPDATES: { | 157 case VERIFY_UPDATES: { |
157 VerifyUpdatesCommand verify_updates; | 158 VerifyUpdatesCommand verify_updates; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 216 |
216 next_step = POST_COMMIT_MESSAGE; | 217 next_step = POST_COMMIT_MESSAGE; |
217 } else { | 218 } else { |
218 next_step = BUILD_AND_PROCESS_CONFLICT_SETS; | 219 next_step = BUILD_AND_PROCESS_CONFLICT_SETS; |
219 } | 220 } |
220 | 221 |
221 break; | 222 break; |
222 } | 223 } |
223 case POST_COMMIT_MESSAGE: { | 224 case POST_COMMIT_MESSAGE: { |
224 PostCommitMessageCommand post_commit_command; | 225 PostCommitMessageCommand post_commit_command; |
225 post_commit_command.Execute(session); | 226 session->mutable_status_controller()->set_last_post_commit_result( |
| 227 post_commit_command.Execute(session)); |
226 next_step = PROCESS_COMMIT_RESPONSE; | 228 next_step = PROCESS_COMMIT_RESPONSE; |
227 break; | 229 break; |
228 } | 230 } |
229 case PROCESS_COMMIT_RESPONSE: { | 231 case PROCESS_COMMIT_RESPONSE: { |
230 session->mutable_status_controller()->reset_num_conflicting_commits(); | 232 session->mutable_status_controller()->reset_num_conflicting_commits(); |
231 ProcessCommitResponseCommand process_response_command; | 233 ProcessCommitResponseCommand process_response_command; |
232 process_response_command.Execute(session); | 234 session->mutable_status_controller()-> |
| 235 set_last_process_commit_response_result( |
| 236 process_response_command.Execute(session)); |
233 next_step = BUILD_AND_PROCESS_CONFLICT_SETS; | 237 next_step = BUILD_AND_PROCESS_CONFLICT_SETS; |
234 break; | 238 break; |
235 } | 239 } |
236 case BUILD_AND_PROCESS_CONFLICT_SETS: { | 240 case BUILD_AND_PROCESS_CONFLICT_SETS: { |
237 BuildAndProcessConflictSetsCommand build_process_conflict_sets; | 241 BuildAndProcessConflictSetsCommand build_process_conflict_sets; |
238 build_process_conflict_sets.Execute(session); | 242 build_process_conflict_sets.Execute(session); |
239 if (session->status_controller().conflict_sets_built()) | 243 if (session->status_controller().conflict_sets_built()) |
240 next_step = SYNCER_END; | 244 next_step = SYNCER_END; |
241 else | 245 else |
242 next_step = RESOLVE_CONFLICTS; | 246 next_step = RESOLVE_CONFLICTS; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 entry->Put(SERVER_CTIME, Time()); | 352 entry->Put(SERVER_CTIME, Time()); |
349 entry->Put(SERVER_VERSION, 0); | 353 entry->Put(SERVER_VERSION, 0); |
350 entry->Put(SERVER_IS_DIR, false); | 354 entry->Put(SERVER_IS_DIR, false); |
351 entry->Put(SERVER_IS_DEL, false); | 355 entry->Put(SERVER_IS_DEL, false); |
352 entry->Put(IS_UNAPPLIED_UPDATE, false); | 356 entry->Put(IS_UNAPPLIED_UPDATE, false); |
353 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 357 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
354 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 358 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
355 } | 359 } |
356 | 360 |
357 } // namespace browser_sync | 361 } // namespace browser_sync |
OLD | NEW |