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

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: 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..43423e18e707b236cafd9954bb959907165cb426 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 custom passphrase using this device.
+ //
+ // |nigori_state| can be used to restore nigori state across
+ // SyncEncryptionHandlerImpl lifetimes. See also SyncEncryptionHandlerImpl's
+ // RestoredNigori method.
+ virtual void OnLocalSetCustomPassphrase(
+ const NigoriState& nigori_state) = 0;
+
protected:
virtual ~Observer();
};
+ struct NigoriState {
+ sync_pb::NigoriSpecifics nigori_specifics;
Nicolas Zea 2015/06/11 17:43:07 Do you expect to persist any other information as
maniscalco 2015/06/15 16:49:18 Currently, I think the NigoriSpecifics is all I wi
+ };
+
SyncEncryptionHandler();
virtual ~SyncEncryptionHandler();

Powered by Google App Engine
This is Rietveld 408576698