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 | |
|
maniscalco
2014/04/15 16:29:14
How do you envision backups working with attachmen
haitaol1
2014/04/15 16:59:51
Backup is only for local data. Does local model cr
maniscalco
2014/04/15 17:21:19
Model type code will not create attachments when s
haitaol1
2014/04/15 18:11:20
Done.
| |
| 15 // into sync DB. | |
| 16 class SyncBackupManager : public SyncRollbackManagerBase { | |
| 17 public: | |
| 18 SyncBackupManager(); | |
| 19 virtual ~SyncBackupManager(); | |
| 20 | |
| 21 // SyncManager implementation. | |
| 22 virtual void SaveChanges() OVERRIDE; | |
| 23 | |
| 24 // DirectoryChangeDelegate implementation. | |
| 25 virtual ModelTypeSet HandleTransactionEndingChangeEvent( | |
| 26 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | |
| 27 syncable::BaseTransaction* trans) OVERRIDE; | |
| 28 | |
| 29 private: | |
| 30 // Replaces local IDs with server IDs and clear unsynced bit of modified | |
| 31 // entries. | |
| 32 void NormalizeEntries(); | |
| 33 | |
| 34 // Handles of unsynced entries caused by local model changes. | |
| 35 std::set<int64> unsynced_; | |
| 36 | |
| 37 // True if NormalizeEntries() is being called. | |
| 38 bool in_normalization_; | |
| 39 }; | |
| 40 | |
| 41 } // namespace syncer | |
| 42 | |
| 43 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | |
| OLD | NEW |