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 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // to SyncShare() may take an unbounded amount of time, as SyncerCommands | 69 // to SyncShare() may take an unbounded amount of time, as SyncerCommands |
70 // may block on network i/o, on lock contention, or on tasks posted to | 70 // may block on network i/o, on lock contention, or on tasks posted to |
71 // other threads. | 71 // other threads. |
72 class Syncer { | 72 class Syncer { |
73 public: | 73 public: |
74 typedef std::vector<int64> UnsyncedMetaHandles; | 74 typedef std::vector<int64> UnsyncedMetaHandles; |
75 | 75 |
76 // The constructor may be called from a thread that is not the Syncer's | 76 // The constructor may be called from a thread that is not the Syncer's |
77 // dedicated thread, to allow some flexibility in the setup. | 77 // dedicated thread, to allow some flexibility in the setup. |
78 explicit Syncer(sessions::SyncSessionContext* context); | 78 explicit Syncer(sessions::SyncSessionContext* context); |
79 ~Syncer() {} | 79 ~Syncer(); |
80 | 80 |
81 // Called by other threads to tell the syncer to stop what it's doing | 81 // Called by other threads to tell the syncer to stop what it's doing |
82 // and return early from SyncShare, if possible. | 82 // and return early from SyncShare, if possible. |
83 bool ExitRequested() { | 83 bool ExitRequested() { |
84 AutoLock lock(early_exit_requested_lock_); | 84 AutoLock lock(early_exit_requested_lock_); |
85 return early_exit_requested_; | 85 return early_exit_requested_; |
86 } | 86 } |
87 void RequestEarlyExit() { | 87 void RequestEarlyExit() { |
88 AutoLock lock(early_exit_requested_lock_); | 88 AutoLock lock(early_exit_requested_lock_); |
89 early_exit_requested_ = true; | 89 early_exit_requested_ = true; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 } | 206 } |
207 return false; | 207 return false; |
208 } | 208 } |
209 // Utility function declarations. | 209 // Utility function declarations. |
210 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); | 210 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); |
211 void ClearServerData(syncable::MutableEntry* entry); | 211 void ClearServerData(syncable::MutableEntry* entry); |
212 | 212 |
213 } // namespace browser_sync | 213 } // namespace browser_sync |
214 | 214 |
215 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ | 215 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCER_H_ |
OLD | NEW |