| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "sync/internal_api/sync_rollback_manager_base.h" | 10 #include "sync/internal_api/sync_rollback_manager_base.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, | 31 const syncable::ImmutableWriteTransactionInfo& write_transaction_info, |
| 32 syncable::BaseTransaction* trans) override; | 32 syncable::BaseTransaction* trans) override; |
| 33 | 33 |
| 34 void RegisterDirectoryTypeDebugInfoObserver( | 34 void RegisterDirectoryTypeDebugInfoObserver( |
| 35 syncer::TypeDebugInfoObserver* observer) override; | 35 syncer::TypeDebugInfoObserver* observer) override; |
| 36 void UnregisterDirectoryTypeDebugInfoObserver( | 36 void UnregisterDirectoryTypeDebugInfoObserver( |
| 37 syncer::TypeDebugInfoObserver* observer) override; | 37 syncer::TypeDebugInfoObserver* observer) override; |
| 38 bool HasDirectoryTypeDebugInfoObserver( | 38 bool HasDirectoryTypeDebugInfoObserver( |
| 39 syncer::TypeDebugInfoObserver* observer) override; | 39 syncer::TypeDebugInfoObserver* observer) override; |
| 40 void RequestEmitDebugInfo() override; | 40 void RequestEmitDebugInfo() override; |
| 41 void ClearServerData(const ClearServerDataCallback& callback) override; |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 // Replaces local IDs with server IDs and clear unsynced bit of modified | 44 // Replaces local IDs with server IDs and clear unsynced bit of modified |
| 44 // entries. | 45 // entries. |
| 45 void NormalizeEntries(); | 46 void NormalizeEntries(); |
| 46 | 47 |
| 47 // Manipulate preference nodes so that they'll be overwritten by local | 48 // Manipulate preference nodes so that they'll be overwritten by local |
| 48 // preference values during model association, i.e. local wins instead of | 49 // preference values during model association, i.e. local wins instead of |
| 49 // server wins. This is for preventing backup from changing preferences in | 50 // server wins. This is for preventing backup from changing preferences in |
| 50 // case backup DB has hijacked preferences. | 51 // case backup DB has hijacked preferences. |
| 51 void HideSyncPreference(ModelType pref_type); | 52 void HideSyncPreference(ModelType pref_type); |
| 52 | 53 |
| 53 // Handles of unsynced entries caused by local model changes. | 54 // Handles of unsynced entries caused by local model changes. |
| 54 std::set<int64> unsynced_; | 55 std::set<int64> unsynced_; |
| 55 | 56 |
| 56 // True if NormalizeEntries() is being called. | 57 // True if NormalizeEntries() is being called. |
| 57 bool in_normalization_; | 58 bool in_normalization_; |
| 58 | 59 |
| 59 SyncStatus status_; | 60 SyncStatus status_; |
| 60 | 61 |
| 61 DISALLOW_COPY_AND_ASSIGN(SyncBackupManager); | 62 DISALLOW_COPY_AND_ASSIGN(SyncBackupManager); |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace syncer | 65 } // namespace syncer |
| 65 | 66 |
| 66 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ | 67 #endif // SYNC_INTERNAL_API_SYNC_BACKUP_MANAGER_H_ |
| OLD | NEW |