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

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: 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/profile_sync_service.h
diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h
index ec9ce6b42d1dcbae09a1c801c534273c4f8bdc58..f0f057e739836e036444e6aec4377e115a03f36d 100644
--- a/chrome/browser/sync/profile_sync_service.h
+++ b/chrome/browser/sync/profile_sync_service.h
@@ -190,6 +190,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,
@@ -434,6 +436,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.
+ // 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();
@@ -640,6 +655,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);
};
« no previous file with comments | « chrome/browser/sync/js_sync_manager_observer_unittest.cc ('k') | chrome/browser/sync/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698