| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_BACKUP_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ |
| 6 #define SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <set> | 10 #include <set> |
| 9 | 11 |
| 12 #include "base/macros.h" |
| 10 #include "sync/internal_api/sync_rollback_manager_base.h" | 13 #include "sync/internal_api/sync_rollback_manager_base.h" |
| 11 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 12 | 15 |
| 13 namespace syncer { | 16 namespace syncer { |
| 14 | 17 |
| 15 // SyncBackupManager runs before user signs in to sync to back up user's data | 18 // SyncBackupManager runs before user signs in to sync to back up user's data |
| 16 // before sync starts. The data that's backed up can be used to restore user's | 19 // before sync starts. The data that's backed up can be used to restore user's |
| 17 // settings to pre-sync state. | 20 // settings to pre-sync state. |
| 18 class SYNC_EXPORT SyncBackupManager : public SyncRollbackManagerBase { | 21 class SYNC_EXPORT SyncBackupManager : public SyncRollbackManagerBase { |
| 19 public: | 22 public: |
| (...skipping 25 matching lines...) Expand all Loading... |
| 45 // entries. | 48 // entries. |
| 46 void NormalizeEntries(); | 49 void NormalizeEntries(); |
| 47 | 50 |
| 48 // Manipulate preference nodes so that they'll be overwritten by local | 51 // Manipulate preference nodes so that they'll be overwritten by local |
| 49 // preference values during model association, i.e. local wins instead of | 52 // preference values during model association, i.e. local wins instead of |
| 50 // server wins. This is for preventing backup from changing preferences in | 53 // server wins. This is for preventing backup from changing preferences in |
| 51 // case backup DB has hijacked preferences. | 54 // case backup DB has hijacked preferences. |
| 52 void HideSyncPreference(ModelType pref_type); | 55 void HideSyncPreference(ModelType pref_type); |
| 53 | 56 |
| 54 // Handles of unsynced entries caused by local model changes. | 57 // Handles of unsynced entries caused by local model changes. |
| 55 std::set<int64> unsynced_; | 58 std::set<int64_t> unsynced_; |
| 56 | 59 |
| 57 // True if NormalizeEntries() is being called. | 60 // True if NormalizeEntries() is being called. |
| 58 bool in_normalization_; | 61 bool in_normalization_; |
| 59 | 62 |
| 60 SyncStatus status_; | 63 SyncStatus status_; |
| 61 | 64 |
| 62 DISALLOW_COPY_AND_ASSIGN(SyncBackupManager); | 65 DISALLOW_COPY_AND_ASSIGN(SyncBackupManager); |
| 63 }; | 66 }; |
| 64 | 67 |
| 65 } // namespace syncer | 68 } // namespace syncer |
| 66 | 69 |
| 67 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | 70 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ |
| OLD | NEW |