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

Unified Diff: chrome/browser/sync/glue/model_association_manager.cc

Issue 10689178: Merge 144583 - sync: fix reentrancy crash in ModelAssociationManager (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 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: chrome/browser/sync/glue/model_association_manager.cc
===================================================================
--- chrome/browser/sync/glue/model_association_manager.cc (revision 146421)
+++ chrome/browser/sync/glue/model_association_manager.cc (working copy)
@@ -101,12 +101,14 @@
void ModelAssociationManager::Initialize(
syncable::ModelTypeSet desired_types) {
- DCHECK_EQ(state_, IDLE);
+ // TODO(tim): Bug 134550. CHECKing to ensure no reentrancy on dev channel.
+ // Remove this.
+ CHECK_EQ(state_, IDLE);
needs_start_.clear();
needs_stop_.clear();
failed_datatypes_info_.clear();
desired_types_ = desired_types;
- state_ = INITIAILIZED_TO_CONFIGURE;
+ state_ = INITIALIZED_TO_CONFIGURE;
DVLOG(1) << "ModelAssociationManager: Initializing";
@@ -154,14 +156,14 @@
}
void ModelAssociationManager::StartAssociationAsync() {
- DCHECK_EQ(state_, INITIAILIZED_TO_CONFIGURE);
+ DCHECK_EQ(state_, INITIALIZED_TO_CONFIGURE);
state_ = CONFIGURING;
DVLOG(1) << "ModelAssociationManager: Going to start model association";
LoadModelForNextType();
}
void ModelAssociationManager::ResetForReconfiguration() {
- DCHECK_EQ(state_, INITIAILIZED_TO_CONFIGURE);
+ DCHECK_EQ(state_, INITIALIZED_TO_CONFIGURE);
state_ = IDLE;
DVLOG(1) << "ModelAssociationManager: Reseting for reconfiguration";
needs_start_.clear();
@@ -170,7 +172,7 @@
}
void ModelAssociationManager::StopDisabledTypes() {
- DCHECK_EQ(state_, INITIAILIZED_TO_CONFIGURE);
+ DCHECK_EQ(state_, INITIALIZED_TO_CONFIGURE);
DVLOG(1) << "ModelAssociationManager: Stopping disabled types.";
// Stop requested data types.
for (size_t i = 0; i < needs_stop_.size(); ++i) {
@@ -211,7 +213,7 @@
// Now continue stopping any types that have already started.
DCHECK(state_ == IDLE ||
- state_ == INITIAILIZED_TO_CONFIGURE);
+ state_ == INITIALIZED_TO_CONFIGURE);
for (DataTypeController::TypeMap::const_iterator it = controllers_->begin();
it != controllers_->end(); ++it) {
DataTypeController* dtc = (*it).second;
@@ -416,13 +418,18 @@
}
NOTREACHED();
return;
- } else {
+ } else if (state_ == IDLE) {
DVLOG(1) << "ModelAssociationManager: Models loaded after configure cycle"
<< "Informing DTM";
// This datatype finished loading after the deadline imposed by the
// originating configuration cycle. Inform the DataTypeManager that the
// type has loaded, so that association may begin.
result_processor_->OnTypesLoaded();
+ } else {
+ // If we're not IDLE or CONFIGURING, we're being invoked as part of an abort
+ // process (possibly a reconfiguration, or disabling of a broken data type).
+ DVLOG(1) << "ModelAssociationManager: ModelLoadCallback occurred while "
+ << "not IDLE or CONFIGURING. Doing nothing.";
}
}
@@ -502,4 +509,3 @@
}
} // namespace browser_sync
-
« no previous file with comments | « chrome/browser/sync/glue/model_association_manager.h ('k') | chrome/browser/sync/glue/model_association_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698