| 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/location.h" | 7 #include "base/location.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/sync/engine/apply_updates_command.h" | 10 #include "chrome/browser/sync/engine/apply_updates_command.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 case VERIFY_UPDATES: { | 137 case VERIFY_UPDATES: { |
| 138 VLOG(1) << "Verifying Updates"; | 138 VLOG(1) << "Verifying Updates"; |
| 139 VerifyUpdatesCommand verify_updates; | 139 VerifyUpdatesCommand verify_updates; |
| 140 verify_updates.Execute(session); | 140 verify_updates.Execute(session); |
| 141 next_step = PROCESS_UPDATES; | 141 next_step = PROCESS_UPDATES; |
| 142 break; | 142 break; |
| 143 } | 143 } |
| 144 case PROCESS_UPDATES: { | 144 case PROCESS_UPDATES: { |
| 145 VLOG(1) << "Processing Updates"; | 145 VLOG(1) << "Processing Updates"; |
| 146 if (session->status_controller()->ResponseContainsUpdates()) { | 146 ProcessUpdatesCommand process_updates; |
| 147 ProcessUpdatesCommand process_updates; | 147 process_updates.Execute(session); |
| 148 process_updates.Execute(session); | |
| 149 } | |
| 150 next_step = STORE_TIMESTAMPS; | 148 next_step = STORE_TIMESTAMPS; |
| 151 break; | 149 break; |
| 152 } | 150 } |
| 153 case STORE_TIMESTAMPS: { | 151 case STORE_TIMESTAMPS: { |
| 154 VLOG(1) << "Storing timestamps"; | 152 VLOG(1) << "Storing timestamps"; |
| 155 StoreTimestampsCommand store_timestamps; | 153 StoreTimestampsCommand store_timestamps; |
| 156 store_timestamps.Execute(session); | 154 store_timestamps.Execute(session); |
| 157 // We should download all of the updates before attempting to process | 155 // We should download all of the updates before attempting to process |
| 158 // them. | 156 // them. |
| 159 if (session->status_controller()->ServerSaysNothingMoreToDownload() || | 157 if (session->status_controller()->ServerSaysNothingMoreToDownload() || |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 entry->Put(SERVER_CTIME, Time()); | 348 entry->Put(SERVER_CTIME, Time()); |
| 351 entry->Put(SERVER_VERSION, 0); | 349 entry->Put(SERVER_VERSION, 0); |
| 352 entry->Put(SERVER_IS_DIR, false); | 350 entry->Put(SERVER_IS_DIR, false); |
| 353 entry->Put(SERVER_IS_DEL, false); | 351 entry->Put(SERVER_IS_DEL, false); |
| 354 entry->Put(IS_UNAPPLIED_UPDATE, false); | 352 entry->Put(IS_UNAPPLIED_UPDATE, false); |
| 355 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 353 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
| 356 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 354 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
| 357 } | 355 } |
| 358 | 356 |
| 359 } // namespace browser_sync | 357 } // namespace browser_sync |
| OLD | NEW |