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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.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: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index de7f61dc82dc837a95df95d90a248cf7015b841a..8de338c67815a7049dc0bcfcfc8b8aaed8d01f8a 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -109,7 +109,8 @@ class SyncBackendHost::Core
const sync_pb::EncryptedData& pending_keys) OVERRIDE;
virtual void OnPassphraseAccepted() OVERRIDE;
virtual void OnBootstrapTokenUpdated(
- const std::string& bootstrap_token) OVERRIDE;
+ const std::string& bootstrap_token,
+ syncer::BootstrapTokenType type) OVERRIDE;
virtual void OnEncryptedTypesChanged(
syncer::ModelTypeSet encrypted_types,
bool encrypt_everything) OVERRIDE;
@@ -896,23 +897,6 @@ void SyncBackendHost::Core::OnSyncCycleCompleted(
return;
DCHECK_EQ(MessageLoop::current(), sync_loop_);
- if (snapshot.model_neutral_state().last_get_key_result ==
- syncer::SYNCER_OK) {
- // If we just received a new keystore key, get it and make sure we update
- // the bootstrap token with it.
- std::string keystore_token;
- sync_manager_->GetKeystoreKeyBootstrapToken(&keystore_token);
- if (!keystore_token.empty()) {
- DVLOG(1) << "Persisting keystore encryption bootstrap token.";
- host_.Call(FROM_HERE,
- &SyncBackendHost::PersistEncryptionBootstrapToken,
- keystore_token,
- KEYSTORE_BOOTSTRAP_TOKEN);
- } else {
- NOTREACHED();
- }
- }
-
host_.Call(
FROM_HERE,
&SyncBackendHost::HandleSyncCycleCompletedOnFrontendLoop,
@@ -973,14 +957,15 @@ void SyncBackendHost::Core::OnPassphraseAccepted() {
}
void SyncBackendHost::Core::OnBootstrapTokenUpdated(
- const std::string& bootstrap_token) {
+ const std::string& bootstrap_token,
+ syncer::BootstrapTokenType type) {
if (!sync_loop_)
return;
DCHECK_EQ(MessageLoop::current(), sync_loop_);
host_.Call(FROM_HERE,
&SyncBackendHost::PersistEncryptionBootstrapToken,
bootstrap_token,
- PASSPHRASE_BOOTSTRAP_TOKEN);
+ type);
}
void SyncBackendHost::Core::OnStopSyncingPermanently() {
@@ -1428,10 +1413,10 @@ void SyncBackendHost::RetryConfigurationOnFrontendLoop(
void SyncBackendHost::PersistEncryptionBootstrapToken(
const std::string& token,
- BootstrapTokenType token_type) {
+ syncer::BootstrapTokenType token_type) {
CHECK(sync_prefs_.get());
DCHECK(!token.empty());
- if (token_type == PASSPHRASE_BOOTSTRAP_TOKEN)
+ if (token_type == syncer::PASSPHRASE_BOOTSTRAP_TOKEN)
sync_prefs_->SetEncryptionBootstrapToken(token);
else
sync_prefs_->SetKeystoreEncryptionBootstrapToken(token);

Powered by Google App Engine
This is Rietveld 408576698