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 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 void SaveChanges(); | 1027 void SaveChanges(); |
1028 | 1028 |
1029 void RequestEarlyExit(); | 1029 void RequestEarlyExit(); |
1030 | 1030 |
1031 // Issue a final SaveChanges, close sqlite handles, and stop running threads. | 1031 // Issue a final SaveChanges, close sqlite handles, and stop running threads. |
1032 // Must be called from the same thread that called Init(). | 1032 // Must be called from the same thread that called Init(). |
1033 void Shutdown(); | 1033 void Shutdown(); |
1034 | 1034 |
1035 UserShare* GetUserShare() const; | 1035 UserShare* GetUserShare() const; |
1036 | 1036 |
| 1037 // Inform the cryptographer of the most recent passphrase and set of encrypted |
| 1038 // types (from nigori node), then ensure all data that needs encryption is |
| 1039 // encrypted with the appropriate passphrase. |
| 1040 // Note: opens a transaction and can trigger ON_PASSPHRASE_REQUIRED, so must |
| 1041 // only be called after syncapi has been initialized. |
| 1042 void RefreshEncryption(); |
| 1043 |
1037 syncable::ModelTypeSet GetEncryptedDataTypes() const; | 1044 syncable::ModelTypeSet GetEncryptedDataTypes() const; |
1038 | 1045 |
1039 // Uses a read-only transaction to determine if the directory being synced has | 1046 // Uses a read-only transaction to determine if the directory being synced has |
1040 // any remaining unsynced items. | 1047 // any remaining unsynced items. |
1041 bool HasUnsyncedItems() const; | 1048 bool HasUnsyncedItems() const; |
1042 | 1049 |
1043 // Logs the list of unsynced meta handles. | 1050 // Logs the list of unsynced meta handles. |
1044 void LogUnsyncedItems(int level) const; | 1051 void LogUnsyncedItems(int level) const; |
1045 | 1052 |
1046 // Functions used for testing. | 1053 // Functions used for testing. |
1047 | 1054 |
1048 void TriggerOnNotificationStateChangeForTest( | 1055 void TriggerOnNotificationStateChangeForTest( |
1049 bool notifications_enabled); | 1056 bool notifications_enabled); |
1050 | 1057 |
1051 void TriggerOnIncomingNotificationForTest( | 1058 void TriggerOnIncomingNotificationForTest( |
1052 const syncable::ModelTypeBitSet& model_types); | 1059 const syncable::ModelTypeBitSet& model_types); |
1053 | 1060 |
1054 private: | 1061 private: |
1055 // An opaque pointer to the nested private class. | 1062 // An opaque pointer to the nested private class. |
1056 SyncInternal* data_; | 1063 SyncInternal* data_; |
1057 | 1064 |
1058 DISALLOW_COPY_AND_ASSIGN(SyncManager); | 1065 DISALLOW_COPY_AND_ASSIGN(SyncManager); |
1059 }; | 1066 }; |
1060 | 1067 |
1061 } // namespace sync_api | 1068 } // namespace sync_api |
1062 | 1069 |
1063 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 1070 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |