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

Unified Diff: sync/internal_api/sync_encryption_handler_impl.h

Issue 1177853002: [Sync] Add ability to save/restore Nigori to SyncEncryptionHandlerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename in backend as well Created 5 years, 6 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: sync/internal_api/sync_encryption_handler_impl.h
diff --git a/sync/internal_api/sync_encryption_handler_impl.h b/sync/internal_api/sync_encryption_handler_impl.h
index 79f43f2f237ac2c02d1c264a99e0c19653c03aaa..4e466f1ed7f42ee777908b5454d61755d61506e6 100644
--- a/sync/internal_api/sync_encryption_handler_impl.h
+++ b/sync/internal_api/sync_encryption_handler_impl.h
@@ -88,6 +88,11 @@ class SYNC_EXPORT_PRIVATE SyncEncryptionHandlerImpl
base::Time migration_time() const;
base::Time custom_passphrase_time() const;
+ // Restore a saved nigori obtained from OnLocalSetPassphraseEncryption.
+ //
+ // Writes the nigori to the Directory and updates the Cryptographer.
+ void RestoreNigori(const SyncEncryptionHandler::NigoriState& nigori_state);
+
private:
friend class SyncEncryptionHandlerImplTest;
FRIEND_TEST_ALL_PREFIXES(SyncEncryptionHandlerImplTest,
@@ -139,7 +144,10 @@ class SYNC_EXPORT_PRIVATE SyncEncryptionHandlerImpl
// Iterate over all encrypted types ensuring each entry is properly encrypted.
void ReEncryptEverything(WriteTransaction* trans);
- // Apply a nigori update. Updates internal and cryptographer state.
+ // Updates internal and cryptographer state.
+ //
+ // Assumes |nigori| is already present in the Sync Directory.
+ //
// Returns true on success, false if |nigori| was incompatible, and the
// nigori node must be corrected.
// Note: must be called from within a transaction.
@@ -261,6 +269,9 @@ class SYNC_EXPORT_PRIVATE SyncEncryptionHandlerImpl
// (if known). Else return base::Time().
base::Time GetExplicitPassphraseTime() const;
+ // Notify observers when a custom passphrase is set by this device.
+ void NotifyObserversOfLocalCustomPassphrase(WriteTransaction* trans);
+
base::ThreadChecker thread_checker_;
base::ObserverList<SyncEncryptionHandler::Observer> observers_;
« no previous file with comments | « sync/internal_api/public/sync_encryption_handler.h ('k') | sync/internal_api/sync_encryption_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698