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

Unified Diff: sync/internal_api/public/sync_encryption_handler.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/public/sync_encryption_handler.h
diff --git a/sync/internal_api/public/sync_encryption_handler.h b/sync/internal_api/public/sync_encryption_handler.h
index bf5a6efe80c1061b0b24169db0cd5573bef6c76a..f8f768ef725a13618b14fc92660ddc3f7835ad42 100644
--- a/sync/internal_api/public/sync_encryption_handler.h
+++ b/sync/internal_api/public/sync_encryption_handler.h
@@ -10,10 +10,7 @@
#include "base/time/time.h"
#include "sync/base/sync_export.h"
#include "sync/internal_api/public/base/model_type.h"
-
-namespace sync_pb {
-class EncryptedData;
-}
+#include "sync/protocol/sync.pb.h"
namespace syncer {
@@ -56,6 +53,8 @@ enum BootstrapTokenType {
// methods must be invoked on the sync thread.
class SYNC_EXPORT SyncEncryptionHandler {
public:
+ struct NigoriState;
+
// All Observer methods are done synchronously from within a transaction and
// on the sync thread.
class SYNC_EXPORT Observer {
@@ -123,10 +122,22 @@ class SYNC_EXPORT SyncEncryptionHandler {
virtual void OnPassphraseTypeChanged(PassphraseType type,
base::Time passphrase_time) = 0;
+ // The user has set a passphrase using this device.
+ //
+ // |nigori_state| can be used to restore nigori state across
+ // SyncEncryptionHandlerImpl lifetimes. See also SyncEncryptionHandlerImpl's
+ // RestoredNigori method.
+ virtual void OnLocalSetPassphraseEncryption(
+ const NigoriState& nigori_state) = 0;
+
protected:
virtual ~Observer();
};
+ struct NigoriState {
+ sync_pb::NigoriSpecifics nigori_specifics;
+ };
+
SyncEncryptionHandler();
virtual ~SyncEncryptionHandler();
« no previous file with comments | « sync/internal_api/js_sync_encryption_handler_observer.cc ('k') | sync/internal_api/sync_encryption_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698