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 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 801 |
802 // Called when initialization is complete to the point that SyncManager can | 802 // Called when initialization is complete to the point that SyncManager can |
803 // process changes. This does not necessarily mean authentication succeeded | 803 // process changes. This does not necessarily mean authentication succeeded |
804 // or that the SyncManager is online. | 804 // or that the SyncManager is online. |
805 // IMPORTANT: Creating any type of transaction before receiving this | 805 // IMPORTANT: Creating any type of transaction before receiving this |
806 // notification is illegal! | 806 // notification is illegal! |
807 // WARNING: Calling methods on the SyncManager before receiving this | 807 // WARNING: Calling methods on the SyncManager before receiving this |
808 // message, unless otherwise specified, produces undefined behavior. | 808 // message, unless otherwise specified, produces undefined behavior. |
809 virtual void OnInitializationComplete() = 0; | 809 virtual void OnInitializationComplete() = 0; |
810 | 810 |
811 // The syncer thread has been paused. | |
812 virtual void OnPaused() = 0; | |
813 | |
814 // The syncer thread has been resumed. | |
815 virtual void OnResumed() = 0; | |
816 | |
817 // We are no longer permitted to communicate with the server. Sync should | 811 // We are no longer permitted to communicate with the server. Sync should |
818 // be disabled and state cleaned up at once. This can happen for a number | 812 // be disabled and state cleaned up at once. This can happen for a number |
819 // of reasons, e.g. swapping from a test instance to production, or a | 813 // of reasons, e.g. swapping from a test instance to production, or a |
820 // global stop syncing operation has wiped the store. | 814 // global stop syncing operation has wiped the store. |
821 virtual void OnStopSyncingPermanently() = 0; | 815 virtual void OnStopSyncingPermanently() = 0; |
822 | 816 |
823 // After a request to clear server data, these callbacks are invoked to | 817 // After a request to clear server data, these callbacks are invoked to |
824 // indicate success or failure. | 818 // indicate success or failure. |
825 virtual void OnClearServerDataSucceeded() = 0; | 819 virtual void OnClearServerDataSucceeded() = 0; |
826 virtual void OnClearServerDataFailed() = 0; | 820 virtual void OnClearServerDataFailed() = 0; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
910 // setting a passphrase as opposed to implicitly (from the users' perspective) | 904 // setting a passphrase as opposed to implicitly (from the users' perspective) |
911 // using their Google Account password. An implicit SetPassphrase will *not* | 905 // using their Google Account password. An implicit SetPassphrase will *not* |
912 // *not* override an explicit passphrase set previously. | 906 // *not* override an explicit passphrase set previously. |
913 void SetPassphrase(const std::string& passphrase, bool is_explicit); | 907 void SetPassphrase(const std::string& passphrase, bool is_explicit); |
914 | 908 |
915 // Set the datatypes we want to encrypt and encrypt any nodes as necessary. | 909 // Set the datatypes we want to encrypt and encrypt any nodes as necessary. |
916 // Note: |encrypted_types| will be unioned with the current set of encrypted | 910 // Note: |encrypted_types| will be unioned with the current set of encrypted |
917 // types, as we do not currently support decrypting datatypes. | 911 // types, as we do not currently support decrypting datatypes. |
918 void EncryptDataTypes(const syncable::ModelTypeSet& encrypted_types); | 912 void EncryptDataTypes(const syncable::ModelTypeSet& encrypted_types); |
919 | 913 |
920 // Requests the syncer thread to pause. The observer's OnPause | |
921 // method will be called when the syncer thread is paused. Returns | |
922 // false if the syncer thread can not be paused (e.g. if it is not | |
923 // started). | |
924 // TODO(tim): Deprecated. | |
925 bool RequestPause(); | |
926 | |
927 // Requests the syncer thread to resume. The observer's OnResume | |
928 // method will be called when the syncer thread is resumed. Returns | |
929 // false if the syncer thread can not be resumed (e.g. if it is not | |
930 // paused). | |
931 // TODO(tim): Deprecated. | |
932 bool RequestResume(); | |
933 | |
934 // Puts the SyncerThread into a mode where no normal nudge or poll traffic | 914 // Puts the SyncerThread into a mode where no normal nudge or poll traffic |
935 // will occur, but calls to RequestConfig will be supported. If |callback| | 915 // will occur, but calls to RequestConfig will be supported. If |callback| |
936 // is provided, it will be invoked (from the internal SyncerThread) when | 916 // is provided, it will be invoked (from the internal SyncerThread) when |
937 // the thread has changed to configuration mode. | 917 // the thread has changed to configuration mode. |
938 void StartConfigurationMode(ModeChangeCallback* callback); | 918 void StartConfigurationMode(ModeChangeCallback* callback); |
939 | 919 |
940 // For the new SyncerThread impl, this switches the mode of operation to | 920 // For the new SyncerThread impl, this switches the mode of operation to |
941 // CONFIGURATION_MODE and schedules a config task to fetch updates for | 921 // CONFIGURATION_MODE and schedules a config task to fetch updates for |
942 // |types|. It is an error to call this with legacy SyncerThread in use. | 922 // |types|. It is an error to call this with legacy SyncerThread in use. |
943 void RequestConfig(const syncable::ModelTypeBitSet& types); | 923 void RequestConfig(const syncable::ModelTypeBitSet& types); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 private: | 1010 private: |
1031 // An opaque pointer to the nested private class. | 1011 // An opaque pointer to the nested private class. |
1032 SyncInternal* data_; | 1012 SyncInternal* data_; |
1033 | 1013 |
1034 DISALLOW_COPY_AND_ASSIGN(SyncManager); | 1014 DISALLOW_COPY_AND_ASSIGN(SyncManager); |
1035 }; | 1015 }; |
1036 | 1016 |
1037 } // namespace sync_api | 1017 } // namespace sync_api |
1038 | 1018 |
1039 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 1019 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
OLD | NEW |