Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Unified Diff: chrome/browser/sync/glue/sync_backend_host.h

Issue 6465005: [Sync] Initial support for encrypting any datatype (no UI hookup yet). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + small fix Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 4b3d1640f8c54fb466b5528fc1b1903242970984..317cbccd4599edce4a5e1a34b55b140649bd930a 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -88,6 +88,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() {
@@ -160,6 +163,13 @@ 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.
+ // Note: actual work is done on core_thread_'s message loop.
+ virtual void EncryptDataTypes(
+ const syncable::ModelTypeSet& encrypted_types);
+
syncable::AutofillMigrationState
GetAutofillMigrationState();
@@ -276,6 +286,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);
// JsBackend implementation.
virtual void SetParentJsEventRouter(JsEventRouter* router);
@@ -343,6 +355,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
@@ -380,7 +396,6 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
void DoInitializeForTest(const std::wstring& test_user,
sync_api::HttpPostProviderFactory* factory,
bool delete_sync_data_folder) {
-
// Construct dummy credentials for test.
sync_api::SyncCredentials credentials;
credentials.email = WideToUTF8(test_user);
@@ -439,6 +454,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(
@@ -507,7 +527,6 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar {
scoped_refptr<Core> core_;
private:
-
UIModelWorker* ui_worker();
void ConfigureAutofillMigration();
« no previous file with comments | « chrome/browser/sync/glue/session_model_associator_unittest.cc ('k') | chrome/browser/sync/glue/sync_backend_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698