OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
10 #include "chrome/browser/sync/engine/apply_updates_command.h" | 10 #include "chrome/browser/sync/engine/apply_updates_command.h" |
11 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" | 11 #include "chrome/browser/sync/engine/build_and_process_conflict_sets_command.h" |
12 #include "chrome/browser/sync/engine/build_commit_command.h" | 12 #include "chrome/browser/sync/engine/build_commit_command.h" |
| 13 #include "chrome/browser/sync/engine/cleanup_disabled_types_command.h" |
13 #include "chrome/browser/sync/engine/conflict_resolver.h" | 14 #include "chrome/browser/sync/engine/conflict_resolver.h" |
14 #include "chrome/browser/sync/engine/download_updates_command.h" | 15 #include "chrome/browser/sync/engine/download_updates_command.h" |
15 #include "chrome/browser/sync/engine/get_commit_ids_command.h" | 16 #include "chrome/browser/sync/engine/get_commit_ids_command.h" |
16 #include "chrome/browser/sync/engine/net/server_connection_manager.h" | 17 #include "chrome/browser/sync/engine/net/server_connection_manager.h" |
17 #include "chrome/browser/sync/engine/post_commit_message_command.h" | 18 #include "chrome/browser/sync/engine/post_commit_message_command.h" |
18 #include "chrome/browser/sync/engine/process_commit_response_command.h" | 19 #include "chrome/browser/sync/engine/process_commit_response_command.h" |
19 #include "chrome/browser/sync/engine/process_updates_command.h" | 20 #include "chrome/browser/sync/engine/process_updates_command.h" |
20 #include "chrome/browser/sync/engine/resolve_conflicts_command.h" | 21 #include "chrome/browser/sync/engine/resolve_conflicts_command.h" |
21 #include "chrome/browser/sync/engine/store_timestamps_command.h" | 22 #include "chrome/browser/sync/engine/store_timestamps_command.h" |
22 #include "chrome/browser/sync/engine/syncer_end_command.h" | 23 #include "chrome/browser/sync/engine/syncer_end_command.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 void Syncer::SyncShare(sessions::SyncSession* session, | 113 void Syncer::SyncShare(sessions::SyncSession* session, |
113 const SyncerStep first_step, | 114 const SyncerStep first_step, |
114 const SyncerStep last_step) { | 115 const SyncerStep last_step) { |
115 SyncerStep current_step = first_step; | 116 SyncerStep current_step = first_step; |
116 | 117 |
117 SyncerStep next_step = current_step; | 118 SyncerStep next_step = current_step; |
118 while (!ExitRequested()) { | 119 while (!ExitRequested()) { |
119 switch (current_step) { | 120 switch (current_step) { |
120 case SYNCER_BEGIN: | 121 case SYNCER_BEGIN: |
121 LOG(INFO) << "Syncer Begin"; | 122 LOG(INFO) << "Syncer Begin"; |
| 123 next_step = CLEANUP_DISABLED_TYPES; |
| 124 break; |
| 125 case CLEANUP_DISABLED_TYPES: { |
| 126 LOG(INFO) << "Cleaning up disabled types"; |
| 127 CleanupDisabledTypesCommand cleanup; |
| 128 cleanup.Execute(session); |
122 next_step = DOWNLOAD_UPDATES; | 129 next_step = DOWNLOAD_UPDATES; |
123 break; | 130 break; |
| 131 } |
124 case DOWNLOAD_UPDATES: { | 132 case DOWNLOAD_UPDATES: { |
125 LOG(INFO) << "Downloading Updates"; | 133 LOG(INFO) << "Downloading Updates"; |
126 DownloadUpdatesCommand download_updates; | 134 DownloadUpdatesCommand download_updates; |
127 download_updates.Execute(session); | 135 download_updates.Execute(session); |
128 next_step = PROCESS_CLIENT_COMMAND; | 136 next_step = PROCESS_CLIENT_COMMAND; |
129 break; | 137 break; |
130 } | 138 } |
131 case PROCESS_CLIENT_COMMAND: { | 139 case PROCESS_CLIENT_COMMAND: { |
132 LOG(INFO) << "Processing Client Command"; | 140 LOG(INFO) << "Processing Client Command"; |
133 ProcessClientCommand(session); | 141 ProcessClientCommand(session); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 entry->Put(SERVER_CTIME, 0); | 325 entry->Put(SERVER_CTIME, 0); |
318 entry->Put(SERVER_VERSION, 0); | 326 entry->Put(SERVER_VERSION, 0); |
319 entry->Put(SERVER_IS_DIR, false); | 327 entry->Put(SERVER_IS_DIR, false); |
320 entry->Put(SERVER_IS_DEL, false); | 328 entry->Put(SERVER_IS_DEL, false); |
321 entry->Put(IS_UNAPPLIED_UPDATE, false); | 329 entry->Put(IS_UNAPPLIED_UPDATE, false); |
322 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); | 330 entry->Put(SERVER_SPECIFICS, sync_pb::EntitySpecifics::default_instance()); |
323 entry->Put(SERVER_POSITION_IN_PARENT, 0); | 331 entry->Put(SERVER_POSITION_IN_PARENT, 0); |
324 } | 332 } |
325 | 333 |
326 } // namespace browser_sync | 334 } // namespace browser_sync |
OLD | NEW |