OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1026 // Call periodically from a database-safe thread to persist recent changes | 1026 // Call periodically from a database-safe thread to persist recent changes |
1027 // to the syncapi model. | 1027 // to the syncapi model. |
1028 void SaveChanges(); | 1028 void SaveChanges(); |
1029 | 1029 |
1030 // Issue a final SaveChanges, close sqlite handles, and stop running threads. | 1030 // Issue a final SaveChanges, close sqlite handles, and stop running threads. |
1031 // Must be called from the same thread that called Init(). | 1031 // Must be called from the same thread that called Init(). |
1032 void Shutdown(); | 1032 void Shutdown(); |
1033 | 1033 |
1034 UserShare* GetUserShare() const; | 1034 UserShare* GetUserShare() const; |
1035 | 1035 |
| 1036 // Inform the cryptographer of the most recent passphrase and set of encrypted |
| 1037 // types, then ensures all data that needs encryption is encrypted with the |
| 1038 // appropriate passphrase. |
| 1039 // Note: opens a transaction and can trigger ON_PASSPHRASE_REQUIRED, so must |
| 1040 // only be called after syncapi has been initialized. |
| 1041 void ReloadNigori(); |
| 1042 |
1036 syncable::ModelTypeSet GetEncryptedDataTypes() const; | 1043 syncable::ModelTypeSet GetEncryptedDataTypes() const; |
1037 | 1044 |
1038 // Uses a read-only transaction to determine if the directory being synced has | 1045 // Uses a read-only transaction to determine if the directory being synced has |
1039 // any remaining unsynced items. | 1046 // any remaining unsynced items. |
1040 bool HasUnsyncedItems() const; | 1047 bool HasUnsyncedItems() const; |
1041 | 1048 |
1042 // Logs the list of unsynced meta handles. | 1049 // Logs the list of unsynced meta handles. |
1043 void LogUnsyncedItems(int level) const; | 1050 void LogUnsyncedItems(int level) const; |
1044 | 1051 |
1045 // Functions used for testing. | 1052 // Functions used for testing. |
1046 | 1053 |
1047 void TriggerOnNotificationStateChangeForTest( | 1054 void TriggerOnNotificationStateChangeForTest( |
1048 bool notifications_enabled); | 1055 bool notifications_enabled); |
1049 | 1056 |
1050 void TriggerOnIncomingNotificationForTest( | 1057 void TriggerOnIncomingNotificationForTest( |
1051 const syncable::ModelTypeBitSet& model_types); | 1058 const syncable::ModelTypeBitSet& model_types); |
1052 | 1059 |
1053 private: | 1060 private: |
1054 // An opaque pointer to the nested private class. | 1061 // An opaque pointer to the nested private class. |
1055 SyncInternal* data_; | 1062 SyncInternal* data_; |
1056 | 1063 |
1057 DISALLOW_COPY_AND_ASSIGN(SyncManager); | 1064 DISALLOW_COPY_AND_ASSIGN(SyncManager); |
1058 }; | 1065 }; |
1059 | 1066 |
1060 } // namespace sync_api | 1067 } // namespace sync_api |
1061 | 1068 |
1062 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 1069 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |