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_INTERNAL_API_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
156 // This listener is called upon completion of a syncable transaction, and | 156 // This listener is called upon completion of a syncable transaction, and |
157 // builds the list of sync-engine initiated changes that will be forwarded to | 157 // builds the list of sync-engine initiated changes that will be forwarded to |
158 // the SyncManager's Observers. | 158 // the SyncManager's Observers. |
159 virtual void HandleTransactionCompleteChangeEvent( | 159 virtual void HandleTransactionCompleteChangeEvent( |
160 ModelTypeSet models_with_changes) OVERRIDE; | 160 ModelTypeSet models_with_changes) OVERRIDE; |
161 virtual ModelTypeSet HandleTransactionEndingChangeEvent( | 161 virtual ModelTypeSet HandleTransactionEndingChangeEvent( |
162 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 162 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
163 syncable::BaseTransaction* trans) OVERRIDE; | 163 syncable::BaseTransaction* trans) OVERRIDE; |
164 virtual void HandleCalculateChangesChangeEventFromSyncApi( | 164 virtual void HandleCalculateChangesChangeEventFromSyncApi( |
165 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 165 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
166 syncable::BaseTransaction* trans) OVERRIDE; | 166 syncable::BaseTransaction* trans, |
167 std::vector<int64>* entry_changed) OVERRIDE; | |
tim (not reviewing)
2012/11/08 17:38:49
entries_changed is more accurate, I think?
haitaol1
2012/11/08 19:06:53
Done.
| |
167 virtual void HandleCalculateChangesChangeEventFromSyncer( | 168 virtual void HandleCalculateChangesChangeEventFromSyncer( |
168 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 169 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
169 syncable::BaseTransaction* trans) OVERRIDE; | 170 syncable::BaseTransaction* trans, |
171 std::vector<int64>* entry_changed) OVERRIDE; | |
170 | 172 |
171 // InvalidationHandler implementation. | 173 // InvalidationHandler implementation. |
172 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; | 174 virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE; |
173 virtual void OnIncomingInvalidation( | 175 virtual void OnIncomingInvalidation( |
174 const ObjectIdInvalidationMap& invalidation_map, | 176 const ObjectIdInvalidationMap& invalidation_map, |
175 IncomingInvalidationSource source) OVERRIDE; | 177 IncomingInvalidationSource source) OVERRIDE; |
176 | 178 |
177 // Called only by our NetworkChangeNotifier. | 179 // Called only by our NetworkChangeNotifier. |
178 virtual void OnIPAddressChanged() OVERRIDE; | 180 virtual void OnIPAddressChanged() OVERRIDE; |
179 | 181 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 bool VisiblePositionsDiffer( | 216 bool VisiblePositionsDiffer( |
215 const syncable::EntryKernelMutation& mutation) const; | 217 const syncable::EntryKernelMutation& mutation) const; |
216 | 218 |
217 // Determine if any of the fields made visible to clients of the Sync API | 219 // Determine if any of the fields made visible to clients of the Sync API |
218 // differ between the versions of an entry stored in |a| and |b|. A return | 220 // differ between the versions of an entry stored in |a| and |b|. A return |
219 // value of false means that it should be OK to ignore this change. | 221 // value of false means that it should be OK to ignore this change. |
220 bool VisiblePropertiesDiffer( | 222 bool VisiblePropertiesDiffer( |
221 const syncable::EntryKernelMutation& mutation, | 223 const syncable::EntryKernelMutation& mutation, |
222 Cryptographer* cryptographer) const; | 224 Cryptographer* cryptographer) const; |
223 | 225 |
224 bool ChangeBuffersAreEmpty(); | |
225 | |
226 // Open the directory named with username_for_share | 226 // Open the directory named with username_for_share |
227 bool OpenDirectory(); | 227 bool OpenDirectory(); |
228 | 228 |
229 // Purge those types from |previously_enabled_types| that are no longer | 229 // Purge those types from |previously_enabled_types| that are no longer |
230 // enabled in |currently_enabled_types|. | 230 // enabled in |currently_enabled_types|. |
231 bool PurgeDisabledTypes(ModelTypeSet previously_enabled_types, | 231 bool PurgeDisabledTypes(ModelTypeSet previously_enabled_types, |
232 ModelTypeSet currently_enabled_types); | 232 ModelTypeSet currently_enabled_types); |
233 | 233 |
234 void RequestNudgeForDataTypes( | 234 void RequestNudgeForDataTypes( |
235 const tracked_objects::Location& nudge_location, | 235 const tracked_objects::Location& nudge_location, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
322 // Start()ed. | 322 // Start()ed. |
323 scoped_ptr<SyncScheduler> scheduler_; | 323 scoped_ptr<SyncScheduler> scheduler_; |
324 | 324 |
325 // The Invalidator which notifies us when updates need to be downloaded. | 325 // The Invalidator which notifies us when updates need to be downloaded. |
326 scoped_ptr<Invalidator> invalidator_; | 326 scoped_ptr<Invalidator> invalidator_; |
327 | 327 |
328 // A multi-purpose status watch object that aggregates stats from various | 328 // A multi-purpose status watch object that aggregates stats from various |
329 // sync components. | 329 // sync components. |
330 AllStatus allstatus_; | 330 AllStatus allstatus_; |
331 | 331 |
332 // Each element of this array is a store of change records produced by | 332 // Each element of this map is a store of change records produced by |
333 // HandleChangeEvent during the CALCULATE_CHANGES step. The changes are | 333 // HandleChangeEventFromSyncer during the CALCULATE_CHANGES step. The changes |
334 // segregated by model type, and are stored here to be processed and | 334 // are grouped by model type, and are stored here in tree order to be |
335 // forwarded to the observer slightly later, at the TRANSACTION_ENDING | 335 // forwarded to the observer slightly later, at the TRANSACTION_ENDING step |
336 // step by HandleTransactionEndingChangeEvent. The list is cleared in the | 336 // by HandleTransactionEndingChangeEvent. The list is cleared after observer |
337 // TRANSACTION_COMPLETE step by HandleTransactionCompleteChangeEvent. | 337 // finishes processing. |
338 ChangeReorderBuffer change_buffers_[MODEL_TYPE_COUNT]; | 338 typedef std::map<int, ImmutableChangeRecordList> ChangeRecordMap; |
339 ChangeRecordMap change_records_; | |
339 | 340 |
340 SyncManager::ChangeDelegate* change_delegate_; | 341 SyncManager::ChangeDelegate* change_delegate_; |
341 | 342 |
342 // Set to true once Init has been called. | 343 // Set to true once Init has been called. |
343 bool initialized_; | 344 bool initialized_; |
344 | 345 |
345 bool observing_ip_address_changes_; | 346 bool observing_ip_address_changes_; |
346 | 347 |
347 InvalidatorState invalidator_state_; | 348 InvalidatorState invalidator_state_; |
348 | 349 |
(...skipping 23 matching lines...) Expand all Loading... | |
372 // changing passphrases, and in general handles sync-specific interactions | 373 // changing passphrases, and in general handles sync-specific interactions |
373 // with the cryptographer. | 374 // with the cryptographer. |
374 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; | 375 scoped_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; |
375 | 376 |
376 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); | 377 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); |
377 }; | 378 }; |
378 | 379 |
379 } // namespace syncer | 380 } // namespace syncer |
380 | 381 |
381 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ | 382 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_H_ |
OLD | NEW |