| OLD | NEW |
| 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 #ifndef SYNC_ENGINE_SYNCER_H_ | 5 #ifndef SYNC_ENGINE_SYNCER_H_ |
| 6 #define SYNC_ENGINE_SYNCER_H_ | 6 #define SYNC_ENGINE_SYNCER_H_ |
| 7 | 7 |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 Syncer(CancelationSignal* cancelation_signal); | 41 Syncer(CancelationSignal* cancelation_signal); |
| 42 virtual ~Syncer(); | 42 virtual ~Syncer(); |
| 43 | 43 |
| 44 bool ExitRequested(); | 44 bool ExitRequested(); |
| 45 | 45 |
| 46 // Fetches and applies updates, resolves conflicts and commits local changes | 46 // Fetches and applies updates, resolves conflicts and commits local changes |
| 47 // for |request_types| as necessary until client and server states are in | 47 // for |request_types| as necessary until client and server states are in |
| 48 // sync. The |nudge_tracker| contains state that describes why the client is | 48 // sync. The |nudge_tracker| contains state that describes why the client is |
| 49 // out of sync and what must be done to bring it back into sync. | 49 // out of sync and what must be done to bring it back into sync. |
| 50 virtual bool NormalSyncShare(ModelTypeSet request_types, | 50 virtual bool NormalSyncShare(ModelTypeSet request_types, |
| 51 sessions::NudgeTracker* nudge_tracker, | 51 const sessions::NudgeTracker& nudge_tracker, |
| 52 sessions::SyncSession* session); | 52 sessions::SyncSession* session); |
| 53 | 53 |
| 54 // Performs an initial download for the |request_types|. It is assumed that | 54 // Performs an initial download for the |request_types|. It is assumed that |
| 55 // the specified types have no local state, and that their associated change | 55 // the specified types have no local state, and that their associated change |
| 56 // processors are in "passive" mode, so none of the downloaded updates will be | 56 // processors are in "passive" mode, so none of the downloaded updates will be |
| 57 // applied to the model. The |source| is sent up to the server for debug | 57 // applied to the model. The |source| is sent up to the server for debug |
| 58 // purposes. It describes the reson for performing this initial download. | 58 // purposes. It describes the reson for performing this initial download. |
| 59 virtual bool ConfigureSyncShare( | 59 virtual bool ConfigureSyncShare( |
| 60 ModelTypeSet request_types, | 60 ModelTypeSet request_types, |
| 61 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, | 61 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 72 bool DownloadAndApplyUpdates( | 72 bool DownloadAndApplyUpdates( |
| 73 ModelTypeSet request_types, | 73 ModelTypeSet request_types, |
| 74 sessions::SyncSession* session, | 74 sessions::SyncSession* session, |
| 75 GetUpdatesProcessor* get_updates_processor, | 75 GetUpdatesProcessor* get_updates_processor, |
| 76 bool create_mobile_bookmarks_folder); | 76 bool create_mobile_bookmarks_folder); |
| 77 | 77 |
| 78 // This function will commit batches of unsynced items to the server until the | 78 // This function will commit batches of unsynced items to the server until the |
| 79 // number of unsynced and ready to commit items reaches zero or an error is | 79 // number of unsynced and ready to commit items reaches zero or an error is |
| 80 // encountered. A request to exit early will be treated as an error and will | 80 // encountered. A request to exit early will be treated as an error and will |
| 81 // abort any blocking operations. | 81 // abort any blocking operations. |
| 82 SyncerError BuildAndPostCommits(ModelTypeSet request_types, | 82 SyncerError BuildAndPostCommits( |
| 83 sessions::NudgeTracker* nudge_tracker, | 83 ModelTypeSet request_types, |
| 84 sessions::SyncSession* session, | 84 sessions::SyncSession* session, |
| 85 CommitProcessor* commit_processor); | 85 CommitProcessor* commit_processor); |
| 86 | 86 |
| 87 void HandleCycleBegin(sessions::SyncSession* session); | 87 void HandleCycleBegin(sessions::SyncSession* session); |
| 88 bool HandleCycleEnd( | 88 bool HandleCycleEnd( |
| 89 sessions::SyncSession* session, | 89 sessions::SyncSession* session, |
| 90 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source); | 90 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source); |
| 91 | 91 |
| 92 syncer::CancelationSignal* const cancelation_signal_; | 92 syncer::CancelationSignal* const cancelation_signal_; |
| 93 | 93 |
| 94 friend class SyncerTest; | 94 friend class SyncerTest; |
| 95 FRIEND_TEST_ALL_PREFIXES(SyncerTest, NameClashWithResolver); | 95 FRIEND_TEST_ALL_PREFIXES(SyncerTest, NameClashWithResolver); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 112 FRIEND_TEST_ALL_PREFIXES(SyncerTest, DeletingEntryWithLocalEdits); | 112 FRIEND_TEST_ALL_PREFIXES(SyncerTest, DeletingEntryWithLocalEdits); |
| 113 FRIEND_TEST_ALL_PREFIXES(EntryCreatedInNewFolderTest, | 113 FRIEND_TEST_ALL_PREFIXES(EntryCreatedInNewFolderTest, |
| 114 EntryCreatedInNewFolderMidSync); | 114 EntryCreatedInNewFolderMidSync); |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(Syncer); | 116 DISALLOW_COPY_AND_ASSIGN(Syncer); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace syncer | 119 } // namespace syncer |
| 120 | 120 |
| 121 #endif // SYNC_ENGINE_SYNCER_H_ | 121 #endif // SYNC_ENGINE_SYNCER_H_ |
| OLD | NEW |