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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 Syncer(); | 53 Syncer(); |
54 virtual ~Syncer(); | 54 virtual ~Syncer(); |
55 | 55 |
56 // Called by other threads to tell the syncer to stop what it's doing | 56 // Called by other threads to tell the syncer to stop what it's doing |
57 // and return early from SyncShare, if possible. | 57 // and return early from SyncShare, if possible. |
58 bool ExitRequested(); | 58 bool ExitRequested(); |
59 void RequestEarlyExit(); | 59 void RequestEarlyExit(); |
60 | 60 |
61 // Runs a sync cycle from |first_step| to |last_step|. | 61 // Runs a sync cycle from |first_step| to |last_step|. |
62 virtual void SyncShare(sessions::SyncSession* session, | 62 // Returns true if the cycle completed with |last_step|, and false |
| 63 // if it terminated early due to error / exit requested. |
| 64 virtual bool SyncShare(sessions::SyncSession* session, |
63 SyncerStep first_step, | 65 SyncerStep first_step, |
64 SyncerStep last_step); | 66 SyncerStep last_step); |
65 | 67 |
66 private: | 68 private: |
67 bool early_exit_requested_; | 69 bool early_exit_requested_; |
68 base::Lock early_exit_requested_lock_; | 70 base::Lock early_exit_requested_lock_; |
69 | 71 |
70 ConflictResolver resolver_; | 72 ConflictResolver resolver_; |
71 | 73 |
72 friend class SyncerTest; | 74 friend class SyncerTest; |
(...skipping 22 matching lines...) Expand all Loading... |
95 }; | 97 }; |
96 | 98 |
97 // Utility function declarations. | 99 // Utility function declarations. |
98 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); | 100 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); |
99 void ClearServerData(syncable::MutableEntry* entry); | 101 void ClearServerData(syncable::MutableEntry* entry); |
100 const char* SyncerStepToString(const SyncerStep); | 102 const char* SyncerStepToString(const SyncerStep); |
101 | 103 |
102 } // namespace syncer | 104 } // namespace syncer |
103 | 105 |
104 #endif // SYNC_ENGINE_SYNCER_H_ | 106 #endif // SYNC_ENGINE_SYNCER_H_ |
OLD | NEW |