| Index: chrome/browser/sync/glue/sync_backend_host.h
|
| diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
|
| index 01954a570cd1786f9dd7ce8c4e933491c6e7cfc2..3825f87b33df676bb949b0400ee32fb5b94a766d 100644
|
| --- a/chrome/browser/sync/glue/sync_backend_host.h
|
| +++ b/chrome/browser/sync/glue/sync_backend_host.h
|
| @@ -84,6 +84,9 @@ class SyncFrontend {
|
| // encrypted using the accepted passphrase.
|
| virtual void OnPassphraseAccepted() = 0;
|
|
|
| + virtual void OnEncryptionComplete(
|
| + const syncable::ModelTypeSet& encrypted_types) = 0;
|
| +
|
| protected:
|
| // Don't delete through SyncFrontend interface.
|
| virtual ~SyncFrontend() {
|
| @@ -154,6 +157,14 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| const syncable::ModelTypeSet& types,
|
| CancelableTask* ready_task);
|
|
|
| + // Encrypts the specified datatypes and marks them as needing encryption on
|
| + // other machines. This affects all machines synced to this account and all
|
| + // data belonging to the specified types. |encrypted_types| must be a subset
|
| + // of the enabled datatypes.
|
| + // Note: actual work is done on core_thread_'s message loop.
|
| + virtual void EncryptDataTypes(
|
| + const syncable::ModelTypeSet& encrypted_types);
|
| +
|
| syncable::AutofillMigrationState
|
| GetAutofillMigrationState();
|
|
|
| @@ -259,6 +270,8 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| virtual void OnUpdatedToken(const std::string& token);
|
| virtual void OnClearServerDataFailed();
|
| virtual void OnClearServerDataSucceeded();
|
| + virtual void OnEncryptionComplete(
|
| + const syncable::ModelTypeSet& encrypted_types);
|
|
|
| struct DoInitializeOptions {
|
| DoInitializeOptions(
|
| @@ -310,6 +323,10 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| // on behalf of SyncBackendHost::SupplyPassphrase.
|
| void DoSetPassphrase(const std::string& passphrase, bool is_explicit);
|
|
|
| + // Called on SyncBackendHost's |core_thread_| to set the datatypes we need
|
| + // to encrypt as well as encrypt all local data of that type.
|
| + void DoEncryptDataTypes(const syncable::ModelTypeSet& encrypted_types);
|
| +
|
| // The shutdown order is a bit complicated:
|
| // 1) From |core_thread_|, invoke the syncapi Shutdown call to do a final
|
| // SaveChanges, close sqlite handles, and halt the syncer thread (which
|
| @@ -398,6 +415,11 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| // Invoked when an updated token is available from the sync server.
|
| void NotifyUpdatedToken(const std::string& token);
|
|
|
| + // Invoked when sync finishes encrypting new datatypes or has become aware
|
| + // of new datatypes requiring encryption.
|
| + void NotifyEncryptionComplete(const syncable::ModelTypeSet&
|
| + encrypted_types);
|
| +
|
| // Called from Core::OnSyncCycleCompleted to handle updating frontend
|
| // thread components.
|
| void HandleSyncCycleCompletedOnFrontendLoop(
|
| @@ -461,7 +483,6 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
|
| scoped_refptr<Core> core_;
|
|
|
| private:
|
| -
|
| UIModelWorker* ui_worker();
|
|
|
| void ConfigureAutofillMigration();
|
|
|