summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 21:18:48 +0000
committerhaitaol@chromium.org <haitaol@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 21:18:48 +0000
commitbe9cfbcea00f811a40987ea2bd01e3f90dfd99cc (patch)
treeb087e849e713e48bb9104865aef5d3f37ec47f65 /sync
parentcfa4e4bc94157b66e59d02c721387323a06b2af3 (diff)
downloadchromium_src-be9cfbcea00f811a40987ea2bd01e3f90dfd99cc.zip
chromium_src-be9cfbcea00f811a40987ea2bd01e3f90dfd99cc.tar.gz
chromium_src-be9cfbcea00f811a40987ea2bd01e3f90dfd99cc.tar.bz2
Let ProfileSyncService start backup or rollback backend when no user is signed
or when rollback command was received. BUG=362679 TBR=rogerta@chromium.org Review URL: https://codereview.chromium.org/261543002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync')
-rw-r--r--sync/internal_api/base_transaction.cc7
-rw-r--r--sync/internal_api/sync_backup_manager.cc4
-rw-r--r--sync/syncable/model_type.cc1
-rw-r--r--sync/syncable/nigori_util.cc6
4 files changed, 14 insertions, 4 deletions
diff --git a/sync/internal_api/base_transaction.cc b/sync/internal_api/base_transaction.cc
index cbfb246..6fae52c 100644
--- a/sync/internal_api/base_transaction.cc
+++ b/sync/internal_api/base_transaction.cc
@@ -25,8 +25,11 @@ Cryptographer* BaseTransaction::GetCryptographer() const {
}
ModelTypeSet BaseTransaction::GetEncryptedTypes() const {
- return GetDirectory()->GetNigoriHandler()->GetEncryptedTypes(
- this->GetWrappedTrans());
+ syncable::NigoriHandler* nigori_handler =
+ GetDirectory()->GetNigoriHandler();
+ return nigori_handler ?
+ nigori_handler->GetEncryptedTypes(this->GetWrappedTrans()) :
+ ModelTypeSet();
}
} // namespace syncer
diff --git a/sync/internal_api/sync_backup_manager.cc b/sync/internal_api/sync_backup_manager.cc
index 10215be..295f79a 100644
--- a/sync/internal_api/sync_backup_manager.cc
+++ b/sync/internal_api/sync_backup_manager.cc
@@ -103,6 +103,10 @@ void SyncBackupManager::NormalizeEntries() {
if (!entry.GetId().ServerKnows())
entry.PutId(syncable::Id::CreateFromServerId(entry.GetId().value()));
+ if (!entry.GetParentId().ServerKnows()) {
+ entry.PutParentId(syncable::Id::CreateFromServerId(
+ entry.GetParentId().value()));
+ }
entry.PutBaseVersion(1);
entry.PutIsUnsynced(false);
}
diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc
index ecb54d6..caf58ed 100644
--- a/sync/syncable/model_type.cc
+++ b/sync/syncable/model_type.cc
@@ -446,6 +446,7 @@ ModelTypeSet BackupTypes() {
result.Put(EXTENSIONS);
result.Put(SEARCH_ENGINES);
result.Put(APPS);
+ result.Put(APP_LIST);
result.Put(APP_SETTINGS);
result.Put(EXTENSION_SETTINGS);
result.Put(PRIORITY_PREFERENCES);
diff --git a/sync/syncable/nigori_util.cc b/sync/syncable/nigori_util.cc
index f85e325..5463140 100644
--- a/sync/syncable/nigori_util.cc
+++ b/sync/syncable/nigori_util.cc
@@ -155,7 +155,9 @@ bool UpdateEntryWithEncryption(
ModelType type = GetModelTypeFromSpecifics(new_specifics);
DCHECK_GE(type, FIRST_REAL_MODEL_TYPE);
const sync_pb::EntitySpecifics& old_specifics = entry->GetSpecifics();
- const ModelTypeSet encrypted_types = nigori_handler->GetEncryptedTypes(trans);
+ const ModelTypeSet encrypted_types =
+ nigori_handler?
+ nigori_handler->GetEncryptedTypes(trans) : ModelTypeSet();
// It's possible the nigori lost the set of encrypted types. If the current
// specifics are already encrypted, we want to ensure we continue encrypting.
bool was_encrypted = old_specifics.has_encrypted();
@@ -166,7 +168,7 @@ bool UpdateEntryWithEncryption(
}
if ((!SpecificsNeedsEncryption(encrypted_types, new_specifics) &&
!was_encrypted) ||
- !cryptographer->is_initialized()) {
+ !cryptographer || !cryptographer->is_initialized()) {
// No encryption required or we are unable to encrypt.
generated_specifics.CopyFrom(new_specifics);
} else {