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 |
| 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 |