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

Side by Side Diff: sync/engine/syncer.cc

Issue 10559104: sync: Process 'control' data separately (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update patch. Still draft quality. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "sync/engine/syncer.h" 5 #include "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"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "build/build_config.h" 12 #include "build/build_config.h"
13 #include "sync/engine/apply_metadata_updates.h"
13 #include "sync/engine/apply_updates_command.h" 14 #include "sync/engine/apply_updates_command.h"
14 #include "sync/engine/build_commit_command.h" 15 #include "sync/engine/build_commit_command.h"
15 #include "sync/engine/cleanup_disabled_types_command.h" 16 #include "sync/engine/cleanup_disabled_types_command.h"
16 #include "sync/engine/commit.h" 17 #include "sync/engine/commit.h"
17 #include "sync/engine/conflict_resolver.h" 18 #include "sync/engine/conflict_resolver.h"
18 #include "sync/engine/download_updates_command.h" 19 #include "sync/engine/download_updates_command.h"
19 #include "sync/engine/net/server_connection_manager.h" 20 #include "sync/engine/net/server_connection_manager.h"
20 #include "sync/engine/process_commit_response_command.h" 21 #include "sync/engine/process_commit_response_command.h"
21 #include "sync/engine/process_updates_command.h" 22 #include "sync/engine/process_updates_command.h"
22 #include "sync/engine/resolve_conflicts_command.h" 23 #include "sync/engine/resolve_conflicts_command.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 DVLOG(1) << "Aborting sync cycle due to download updates failure"; 160 DVLOG(1) << "Aborting sync cycle due to download updates failure";
160 } else if (!session->status_controller() 161 } else if (!session->status_controller()
161 .ServerSaysNothingMoreToDownload()) { 162 .ServerSaysNothingMoreToDownload()) {
162 next_step = DOWNLOAD_UPDATES; 163 next_step = DOWNLOAD_UPDATES;
163 } else { 164 } else {
164 next_step = APPLY_UPDATES; 165 next_step = APPLY_UPDATES;
165 } 166 }
166 break; 167 break;
167 } 168 }
168 case APPLY_UPDATES: { 169 case APPLY_UPDATES: {
170 // These include encryption updates that should be applied early.
171 // FIXME: Shoud this use the same transaction as ApplyUpdatesCommand?
172 ApplyMetadataUpdates(session->context()->directory());
Nicolas Zea 2012/06/21 02:58:36 We can enforce the early application by just makin
rlarocque 2012/06/21 18:23:27 I'd rather not enforce an ordering constraint on t
tim (not reviewing) 2012/06/22 16:34:15 Yeah, we shouldn't try to force ordering within th
173
169 ApplyUpdatesCommand apply_updates; 174 ApplyUpdatesCommand apply_updates;
170 apply_updates.Execute(session); 175 apply_updates.Execute(session);
171 if (last_step == APPLY_UPDATES) { 176 if (last_step == APPLY_UPDATES) {
172 // We're in configuration mode, but we still need to run the 177 // We're in configuration mode, but we still need to run the
173 // SYNCER_END step. 178 // SYNCER_END step.
174 last_step = SYNCER_END; 179 last_step = SYNCER_END;
175 next_step = SYNCER_END; 180 next_step = SYNCER_END;
176 } else { 181 } else {
177 next_step = COMMIT; 182 next_step = COMMIT;
178 } 183 }
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 entry->Put(SERVER_CTIME, Time()); 293 entry->Put(SERVER_CTIME, Time());
289 entry->Put(SERVER_VERSION, 0); 294 entry->Put(SERVER_VERSION, 0);
290 entry->Put(SERVER_IS_DIR, false); 295 entry->Put(SERVER_IS_DIR, false);
291 entry->Put(SERVER_IS_DEL, false); 296 entry->Put(SERVER_IS_DEL, false);
292 entry->Put(IS_UNAPPLIED_UPDATE, false); 297 entry->Put(IS_UNAPPLIED_UPDATE, false);
293 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); 298 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance());
294 entry->Put(SERVER_POSITION_IN_PARENT, 0); 299 entry->Put(SERVER_POSITION_IN_PARENT, 0);
295 } 300 }
296 301
297 } // namespace browser_sync 302 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698