Commit 035f61af authored by Maksim Moskvitin's avatar Maksim Moskvitin Committed by Commit Bot

Cleanup: Remove saved_nigori_state plumbing

It was used for the ClearServerData flow which has been removed. All
the code removed by this CL was efficiently no-op, since
saved_nigori_state was never set.

Bug: 490836
Change-Id: Idcb658e229b983f006937e943baaf9aade5ac8f7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1583735
Commit-Queue: Maksim Moskvitin <mmoskvitin@google.com>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654873}
parent be08cbf7
......@@ -365,7 +365,6 @@ void SyncEngineBackend::DoInitialize(SyncEngine::InitParams params) {
args.report_unrecoverable_error_function =
params.report_unrecoverable_error_function;
args.cancelation_signal = &stop_syncing_signal_;
args.saved_nigori_state = std::move(params.saved_nigori_state);
args.poll_interval = params.poll_interval;
args.cache_guid = params.cache_guid;
args.birthday = params.birthday;
......
......@@ -251,7 +251,6 @@ class SyncEngineImplTest : public testing::Test {
params.delete_sync_data_folder = true;
params.unrecoverable_error_handler =
MakeWeakHandle(test_unrecoverable_error_handler_.GetWeakPtr()),
params.saved_nigori_state = std::move(saved_nigori_state_);
sync_prefs_->GetInvalidationVersions(&params.invalidation_versions);
backend_->Initialize(std::move(params));
......@@ -325,7 +324,6 @@ class SyncEngineImplTest : public testing::Test {
ModelTypeSet engine_types_;
ModelTypeSet enabled_types_;
std::unique_ptr<NetworkResources> network_resources_;
std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state_;
base::OnceClosure quit_loop_;
testing::NiceMock<MockInvalidationService> invalidator_;
};
......
......@@ -507,7 +507,6 @@ void ProfileSyncService::StartUpSlowEngineComponents() {
params.unrecoverable_error_handler = GetUnrecoverableErrorHandler();
params.report_unrecoverable_error_function =
base::BindRepeating(ReportUnrecoverableError, channel_);
params.saved_nigori_state = crypto_.TakeSavedNigoriState();
sync_prefs_.GetInvalidationVersions(&params.invalidation_versions);
params.poll_interval = sync_prefs_.GetPollInterval();
if (params.poll_interval.is_zero()) {
......
......@@ -353,10 +353,4 @@ SyncServiceCrypto::GetEncryptionObserverProxy() {
weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get());
}
std::unique_ptr<SyncEncryptionHandler::NigoriState>
SyncServiceCrypto::TakeSavedNigoriState() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return std::move(state_.saved_nigori_state);
}
} // namespace syncer
......@@ -68,9 +68,6 @@ class SyncServiceCrypto : public SyncEncryptionHandler::Observer {
// Creates a proxy observer object that will post calls to this thread.
std::unique_ptr<SyncEncryptionHandler::Observer> GetEncryptionObserverProxy();
// Takes the previously saved nigori state; null if there isn't any.
std::unique_ptr<SyncEncryptionHandler::NigoriState> TakeSavedNigoriState();
PassphraseRequiredReason passphrase_required_reason() const {
return state_.passphrase_required_reason;
}
......@@ -115,11 +112,6 @@ class SyncServiceCrypto : public SyncEncryptionHandler::Observer {
// cancel if they e.g. don't remember their explicit passphrase.
bool encryption_pending = false;
// Nigori state after user switching to custom passphrase, saved until
// transition steps complete. It will be injected into new engine after sync
// restart.
std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state;
// We cache the cryptographer's pending keys whenever
// NotifyPassphraseRequired is called. This way, before the UI calls
// SetDecryptionPassphrase on the syncer, it can avoid the overhead of an
......
......@@ -74,7 +74,6 @@ class SyncEngine : public ModelTypeConfigurer {
std::unique_ptr<EngineComponentsFactory> engine_components_factory;
WeakHandle<UnrecoverableErrorHandler> unrecoverable_error_handler;
base::Closure report_unrecoverable_error_function;
std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state;
std::map<ModelType, int64_t> invalidation_versions;
// Initial authoritative values (usually read from prefs).
......
......@@ -242,9 +242,6 @@ class SyncManager {
// Must outlive SyncManager.
CancelationSignal* cancelation_signal;
// Optional nigori state to be restored.
std::unique_ptr<SyncEncryptionHandler::NigoriState> saved_nigori_state;
// Define the polling interval. Must not be zero.
base::TimeDelta poll_interval;
......
......@@ -314,13 +314,6 @@ void SyncManagerImpl::Init(InitArgs* args) {
return;
}
// Now that we have opened the Directory we can restore any previously saved
// nigori specifics.
if (args->saved_nigori_state) {
sync_encryption_handler_->RestoreNigori(*args->saved_nigori_state);
args->saved_nigori_state.reset();
}
if (args->enable_local_sync_backend) {
VLOG(1) << "Running against local sync backend.";
allstatus_.SetLocalBackendFolder(
......
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