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

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

Issue 2621923004: [Sync] Fail softly in SMTP if an error occurs during startup. (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 | components/sync/model_impl/shared_model_type_processor_unittest.cc » ('j') | 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 e6cc241001107b5e0468d6e158493dd327e5af75..4ad248b519120bf024848120928ac708adbcad88 100644
--- a/components/sync/model_impl/shared_model_type_processor.cc
+++ b/components/sync/model_impl/shared_model_type_processor.cc
@@ -48,8 +48,10 @@ void SharedModelTypeProcessor::OnMetadataLoaded(
std::unique_ptr<MetadataBatch> batch) {
DCHECK(CalledOnValidThread());
DCHECK(entities_.empty());
- DCHECK(!is_metadata_loaded_);
- DCHECK(!IsConnected());
+
+ // An error occurred earlier in the model.
+ if (is_metadata_loaded_)
+ return;
is_metadata_loaded_ = true;
// Flip this flag here to cover all cases where we don't need to load data.
@@ -566,7 +568,9 @@ void SharedModelTypeProcessor::OnInitialUpdateReceived(
void SharedModelTypeProcessor::OnInitialPendingDataLoaded(
std::unique_ptr<DataBatch> data_batch) {
- DCHECK(!is_initial_pending_data_loaded_);
+ // An error occurred before this callback.
+ if (is_initial_pending_data_loaded_)
+ return;
ConsumeDataBatch(std::move(data_batch));
is_initial_pending_data_loaded_ = true;
« no previous file with comments | « no previous file | components/sync/model_impl/shared_model_type_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698