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

Unified Diff: chrome/browser/sync/profile_sync_service.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: Self review 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/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index 90acae79c0862da01d51b445ae9e4faa283eac92..bd01396fd05c958308e157d9c2bd9ac8ed97bffa 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -185,6 +185,8 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
virtual void OnClearServerDataSucceeded();
virtual void OnPassphraseRequired(bool for_decryption);
virtual void OnPassphraseAccepted();
+ virtual void OnEncryptionComplete(
+ const syncable::ModelTypeSet& encrypted_types);
// Called when a user enters credentials through UI.
virtual void OnUserSubmittedAuth(const std::string& username,
@@ -424,6 +426,19 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
bool is_explicit,
bool is_creation);
+ // Changes the set of datatypes that require encryption. This affects all
+ // machines synced to this account and all data belonging to the specified
+ // types. |encrypted_types| must be a subset of the active datatypes.
+ // Note that this is an asynchronous operation (the encryption of data is
+ // performed on SyncBackendHost's core thread) and may not have an immediate
+ // effect.
+ virtual void EncryptDataTypes(
+ const syncable::ModelTypeSet& encrypted_types);
+
+ // Get the currently encrypted data types.
+ virtual void GetEncryptedDataTypes(
+ syncable::ModelTypeSet* encrypted_types) const;
+
// Returns whether processing changes is allowed. Check this before doing
// any model-modifying operations.
bool ShouldPushChanges();
@@ -628,6 +643,10 @@ class ProfileSyncService : public browser_sync::SyncFrontend,
// is reworked to allow one-shot commands like clearing server data.
base::OneShotTimer<ProfileSyncService> clear_server_data_timer_;
+ // The set of encrypted types. This is updated whenever datatypes are
+ // encrypted through the OnEncryptionComplete callback of SyncFrontend.
+ syncable::ModelTypeSet encrypted_types_;
+
DISALLOW_COPY_AND_ASSIGN(ProfileSyncService);
};

Powered by Google App Engine
This is Rietveld 408576698