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 ProcessUpdatesCommand process_updates; | 146 if (session->status_controller()->ResponseContainsUpdates()) { |
tim (not reviewing)
2011/11/17 18:46:38
I like this but the pattern here is typically to f
| |
147 process_updates.Execute(session); | 147 ProcessUpdatesCommand process_updates; |
148 process_updates.Execute(session); | |
149 } | |
148 next_step = STORE_TIMESTAMPS; | 150 next_step = STORE_TIMESTAMPS; |
149 break; | 151 break; |
150 } | 152 } |
151 case STORE_TIMESTAMPS: { | 153 case STORE_TIMESTAMPS: { |
152 VLOG(1) << "Storing timestamps"; | 154 VLOG(1) << "Storing timestamps"; |
153 StoreTimestampsCommand store_timestamps; | 155 StoreTimestampsCommand store_timestamps; |
154 store_timestamps.Execute(session); | 156 store_timestamps.Execute(session); |
155 // We should download all of the updates before attempting to process | 157 // We should download all of the updates before attempting to process |
156 // them. | 158 // them. |
157 if (session->status_controller()->ServerSaysNothingMoreToDownload() || | 159 if (session->status_controller()->ServerSaysNothingMoreToDownload() || |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 entry->Put(SERVER_CTIME, Time()); | 350 entry->Put(SERVER_CTIME, Time()); |
349 entry->Put(SERVER_VERSION, 0); | 351 entry->Put(SERVER_VERSION, 0); |
350 entry->Put(SERVER_IS_DIR, false); | 352 entry->Put(SERVER_IS_DIR, false); |
351 entry->Put(SERVER_IS_DEL, false); | 353 entry->Put(SERVER_IS_DEL, false); |
352 entry->Put(IS_UNAPPLIED_UPDATE, false); | 354 entry->Put(IS_UNAPPLIED_UPDATE, false); |
353 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 355 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
354 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 356 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
355 } | 357 } |
356 | 358 |
357 } // namespace browser_sync | 359 } // namespace browser_sync |
OLD | NEW |