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