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

Unified Diff: sync/internal_api/sync_manager_impl.cc

Issue 10878015: [Sync] Move keystore key handling to SyncEncryptionHandlerImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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_manager_impl.cc
diff --git a/sync/internal_api/sync_manager_impl.cc b/sync/internal_api/sync_manager_impl.cc
index d0d2cb79266ea3f9c7edb68e8b539806945cdfda..bfd70061482606661ea89bbe25c84af7cef55233 100644
--- a/sync/internal_api/sync_manager_impl.cc
+++ b/sync/internal_api/sync_manager_impl.cc
@@ -385,7 +385,9 @@ void SyncManagerImpl::Init(
sync_encryption_handler_.reset(new SyncEncryptionHandlerImpl(
&share_,
- encryptor));
+ encryptor,
+ restored_key_for_bootstrapping,
+ restored_keystore_key_for_bootstrapping));
sync_encryption_handler_->AddObserver(this);
sync_encryption_handler_->AddObserver(&debug_info_event_listener_);
sync_encryption_handler_->AddObserver(&js_sync_encryption_handler_observer_);
@@ -465,15 +467,6 @@ void SyncManagerImpl::Init(
UpdateCredentials(credentials);
- // Cryptographer should only be accessed while holding a
- // transaction. Grabbing the user share for the transaction
- // checks the initialization state, so this must come after
- // |initialized_| is set to true.
- ReadTransaction trans(FROM_HERE, GetUserShare());
- trans.GetCryptographer()->Bootstrap(restored_key_for_bootstrapping);
- trans.GetCryptographer()->BootstrapKeystoreKey(
- restored_keystore_key_for_bootstrapping);
-
FOR_EACH_OBSERVER(SyncManager::Observer, observers_,
OnInitializationComplete(
MakeWeakHandle(weak_ptr_factory_.GetWeakPtr()),
@@ -539,7 +532,8 @@ void SyncManagerImpl::OnPassphraseAccepted() {
}
void SyncManagerImpl::OnBootstrapTokenUpdated(
- const std::string& bootstrap_token) {
+ const std::string& bootstrap_token,
+ BootstrapTokenType type) {
// Does nothing.
}
@@ -688,11 +682,6 @@ void SyncManagerImpl::UnregisterInvalidationHandler(
sync_notifier_->UnregisterHandler(handler);
}
-bool SyncManagerImpl::GetKeystoreKeyBootstrapToken(std::string* token) {
- ReadTransaction trans(FROM_HERE, GetUserShare());
- return trans.GetCryptographer()->GetKeystoreKeyBootstrapToken(token);
-}
-
void SyncManagerImpl::AddObserver(SyncManager::Observer* observer) {
DCHECK(thread_checker_.CalledOnValidThread());
observers_.AddObserver(observer);

Powered by Google App Engine
This is Rietveld 408576698