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

Unified Diff: components/sync/model_impl/shared_model_type_processor.cc

Issue 2622223003: [Sync] Don't call start_callback_ if null in SMTP. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/model_impl/shared_model_type_processor.cc
diff --git a/components/sync/model_impl/shared_model_type_processor.cc b/components/sync/model_impl/shared_model_type_processor.cc
index 4ad248b519120bf024848120928ac708adbcad88..d3e9f6f0613652ae7122b636cf20b1e18e937718 100644
--- a/components/sync/model_impl/shared_model_type_processor.cc
+++ b/components/sync/model_impl/shared_model_type_processor.cc
@@ -102,17 +102,15 @@ void SharedModelTypeProcessor::ConnectIfReady() {
if (start_error_) {
error_handler_.Run(start_error_.value());
start_error_.reset();
- start_callback_.Reset();
- return;
+ } else if (start_callback_) {
+ auto activation_context = base::MakeUnique<ActivationContext>();
+ activation_context->model_type_state = model_type_state_;
+ activation_context->type_processor =
+ base::MakeUnique<ModelTypeProcessorProxy>(
+ weak_ptr_factory_.GetWeakPtr(),
+ base::ThreadTaskRunnerHandle::Get());
+ start_callback_.Run(std::move(activation_context));
}
-
- auto activation_context = base::MakeUnique<ActivationContext>();
- activation_context->model_type_state = model_type_state_;
- activation_context->type_processor =
- base::MakeUnique<ModelTypeProcessorProxy>(
- weak_ptr_factory_.GetWeakPtr(), base::ThreadTaskRunnerHandle::Get());
-
- start_callback_.Run(std::move(activation_context));
start_callback_.Reset();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698