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

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

Issue 8356026: [Sync] Cache encrypted types info in ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert to synchronous notifications Created 9 years, 2 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 be1d88a8af0903c1ad0c983cb8d14ca0f1a3fc2b..55175d5ce598d6880f4b2e43984d747b9b7dfb9b 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -90,8 +90,15 @@ class SyncFrontend {
// encrypted using the accepted passphrase.
virtual void OnPassphraseAccepted() = 0;
- virtual void OnEncryptionComplete(
- const syncable::ModelTypeSet& encrypted_types) = 0;
+ // Guaranteed to be called once during initialization and before
+ // encryption is complete, but may be called at other times, too.
+ virtual void OnEncryptedTypesChanged(
+ const syncable::ModelTypeSet& encrypted_types,
+ bool encrypt_everything) = 0;
+
+ // Called when encryption is complete. Always preceded by a call to
+ // OnEncryptedTypesChanged.
Nicolas Zea 2011/10/21 14:29:07 I'm not sure I like enforcing this. See comments i
akalin 2011/10/22 03:28:38 Yeah, me neither. Removed that condition.
+ virtual void OnEncryptionComplete() = 0;
// Called to perform migration of |types|.
virtual void OnMigrationNeededForTypes(
@@ -189,13 +196,6 @@ class SyncBackendHost {
// Turns on encryption of all present and future sync data.
virtual void EnableEncryptEverything();
- // Returns true if we have enabled encrypt everything, false if we only
- // encrypt the sensitive types.
- virtual bool EncryptEverythingEnabled() const;
-
- // Returns the set of encrypted data types.
- virtual syncable::ModelTypeSet GetEncryptedDataTypes() const;
-
// Activates change processing for the given data type. This must
// be called synchronously with the data type's model association so
// no changes are dropped between model association and change
@@ -289,10 +289,12 @@ class SyncBackendHost {
virtual void OnUpdatedToken(const std::string& token) OVERRIDE;
virtual void OnClearServerDataFailed() OVERRIDE;
virtual void OnClearServerDataSucceeded() OVERRIDE;
- virtual void OnEncryptionComplete(
- const syncable::ModelTypeSet& encrypted_types);
+ virtual void OnEncryptedTypesChanged(
+ const syncable::ModelTypeSet& encrypted_types,
+ bool encrypt_everything) OVERRIDE;
+ virtual void OnEncryptionComplete() OVERRIDE;
virtual void OnActionableError(
- const browser_sync::SyncProtocolError& sync_error);
+ const browser_sync::SyncProtocolError& sync_error) OVERRIDE;
struct DoInitializeOptions {
DoInitializeOptions(
@@ -445,10 +447,14 @@ class SyncBackendHost {
// 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);
+ // Invoked when the set of encrypted types changes.
+ void NotifyEncryptedTypesChanged(
+ const syncable::ModelTypeSet& encrypted_types,
+ bool encrypt_everything);
+
+ // Invoked when sync finishes encrypting new datatypes or has
+ // become aware of new datatypes requiring encryption.
Nicolas Zea 2011/10/21 14:29:07 remove the "has become aware of new datatypes..."
akalin 2011/10/22 03:28:38 Done.
+ void NotifyEncryptionComplete();
// Called from Core::OnSyncCycleCompleted to handle updating frontend
// thread components.

Powered by Google App Engine
This is Rietveld 408576698