Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | |
| 6 #define SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 | |
| 10 #include "sync/internal_api/sync_rollback_manager_base.h" | |
| 11 | |
| 12 namespace syncer { | |
| 13 | |
| 14 // SyncBackupManager runs before user signs into sync to back up user's data | |
|
Nicolas Zea
2014/04/15 23:05:51
nit: into -> in to
haitaol1
2014/04/16 21:52:36
Done.
| |
| 15 // before sync starts. The data that's backed up can be used to restore user's | |
| 16 // settings to pre-sync state. | |
| 17 class SyncBackupManager : public SyncRollbackManagerBase { | |
| 18 public: | |
| 19 SyncBackupManager(); | |
| 20 virtual ~SyncBackupManager(); | |
| 21 | |
| 22 // SyncManager implementation. | |
| 23 virtual void SaveChanges() OVERRIDE; | |
| 24 | |
| 25 // DirectoryChangeDelegate implementation. | |
| 26 virtual ModelTypeSet HandleTransactionEndingChangeEvent( | |
| 27 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | |
| 28 syncable::BaseTransaction* trans) OVERRIDE; | |
| 29 | |
| 30 private: | |
| 31 // Replaces local IDs with server IDs and clear unsynced bit of modified | |
| 32 // entries. | |
| 33 void NormalizeEntries(); | |
| 34 | |
| 35 // Handles of unsynced entries caused by local model changes. | |
| 36 std::set<int64> unsynced_; | |
| 37 | |
| 38 // True if NormalizeEntries() is being called. | |
| 39 bool in_normalization_; | |
| 40 }; | |
| 41 | |
| 42 } // namespace syncer | |
| 43 | |
| 44 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | |
| OLD | NEW |