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

Unified Diff: components/sync/driver/non_blocking_data_type_controller.cc

Issue 2339403004: [Sync] Add two more USS integration tests. (Closed)
Patch Set: Address comments. Created 4 years, 3 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: components/sync/driver/non_blocking_data_type_controller.cc
diff --git a/components/sync/driver/non_blocking_data_type_controller.cc b/components/sync/driver/non_blocking_data_type_controller.cc
index aef3e9d63907a4b588d1b7ef6101cf56f7350738..c414de2e7f9126c8522b840731a92545aab71fe4 100644
--- a/components/sync/driver/non_blocking_data_type_controller.cc
+++ b/components/sync/driver/non_blocking_data_type_controller.cc
@@ -131,11 +131,14 @@ void NonBlockingDataTypeController::OnProcessorStarted(
void NonBlockingDataTypeController::RegisterWithBackend(
sync_driver::BackendDataTypeConfigurer* configurer) {
DCHECK(CalledOnValidThread());
+ if (activated_)
+ return;
DCHECK(configurer);
DCHECK(activation_context_);
DCHECK_EQ(MODEL_LOADED, state_);
configurer->ActivateNonBlockingDataType(type(),
std::move(activation_context_));
+ activated_ = true;
}
void NonBlockingDataTypeController::StartAssociating(
@@ -165,7 +168,9 @@ void NonBlockingDataTypeController::DeactivateDataType(
sync_driver::BackendDataTypeConfigurer* configurer) {
DCHECK(CalledOnValidThread());
DCHECK(configurer);
+ DCHECK(activated_);
configurer->DeactivateNonBlockingDataType(type());
+ activated_ = false;
}
void NonBlockingDataTypeController::Stop() {
« no previous file with comments | « components/sync/driver/non_blocking_data_type_controller.h ('k') | components/sync/engine_impl/model_type_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698