Commit 0cc5b117 authored by Maksim Moskvitin's avatar Maksim Moskvitin Committed by Commit Bot

[Sync:USS] Update USS Nigori enabling condition

USS implementation of Nigori isn't compatible with Directory
implementations of other datatypes, because Directory requires USS
unfriendly logic for reencryption.

This change should allow passing Directory-specific integration tests,
while USS implementation of Nigori is enabled and prevent browser
misbehaviour for users, who plays with experimental flags.

Bug: 922900
Change-Id: I4dd4e5251d2496b5221afb5ee7f8f38112e078f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1784604
Commit-Queue: Maksim Moskvitin <mmoskvitin@google.com>
Auto-Submit: Maksim Moskvitin <mmoskvitin@google.com>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#693922}
parent fa9facbf
...@@ -73,6 +73,14 @@ void RecordPerModelTypeInvalidation(int model_type, bool is_grouped) { ...@@ -73,6 +73,14 @@ void RecordPerModelTypeInvalidation(int model_type, bool is_grouped) {
} }
} }
bool ShouldEnableUSSNigori() {
// USS implementation of Nigori is not compatible with Directory
// implementations of Passwords and Bookmarks.
return base::FeatureList::IsEnabled(switches::kSyncUSSNigori) &&
base::FeatureList::IsEnabled(switches::kSyncUSSBookmarks) &&
base::FeatureList::IsEnabled(switches::kSyncUSSPasswords);
}
} // namespace } // namespace
SyncEngineBackend::SyncEngineBackend(const std::string& name, SyncEngineBackend::SyncEngineBackend(const std::string& name,
...@@ -326,7 +334,7 @@ void SyncEngineBackend::DoInitialize(SyncEngine::InitParams params) { ...@@ -326,7 +334,7 @@ void SyncEngineBackend::DoInitialize(SyncEngine::InitParams params) {
registrar_ = std::move(params.registrar); registrar_ = std::move(params.registrar);
syncable::NigoriHandler* nigori_handler = nullptr; syncable::NigoriHandler* nigori_handler = nullptr;
if (base::FeatureList::IsEnabled(switches::kSyncUSSNigori)) { if (ShouldEnableUSSNigori()) {
auto nigori_processor = std::make_unique<NigoriModelTypeProcessor>(); auto nigori_processor = std::make_unique<NigoriModelTypeProcessor>();
nigori_controller_ = std::make_unique<ModelTypeController>( nigori_controller_ = std::make_unique<ModelTypeController>(
NIGORI, std::make_unique<ForwardingModelTypeControllerDelegate>( NIGORI, std::make_unique<ForwardingModelTypeControllerDelegate>(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment