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

Side by Side Diff: components/sync/driver/model_association_manager.cc

Issue 2644373003: Revert of [Sync] Make directory types registration explicit in ModelTypeRegistry (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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/driver/model_association_manager.h" 5 #include "components/sync/driver/model_association_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 for (size_t i = 0; i < arraysize(kStartOrder); i++) { 162 for (size_t i = 0; i < arraysize(kStartOrder); i++) {
163 ModelType type = kStartOrder[i]; 163 ModelType type = kStartOrder[i];
164 if (!desired_types_.Has(type)) 164 if (!desired_types_.Has(type))
165 continue; 165 continue;
166 166
167 DCHECK(controllers_->find(type) != controllers_->end()); 167 DCHECK(controllers_->find(type) != controllers_->end());
168 DataTypeController* dtc = controllers_->find(type)->second.get(); 168 DataTypeController* dtc = controllers_->find(type)->second.get();
169 if (dtc->state() == DataTypeController::NOT_RUNNING) { 169 if (dtc->state() == DataTypeController::NOT_RUNNING) {
170 DCHECK(!loaded_types_.Has(dtc->type())); 170 DCHECK(!loaded_types_.Has(dtc->type()));
171 DCHECK(!associated_types_.Has(dtc->type())); 171 DCHECK(!associated_types_.Has(dtc->type()));
172 delegate_->OnSingleDataTypeWillStart(dtc->type());
173 dtc->LoadModels(base::Bind(&ModelAssociationManager::ModelLoadCallback, 172 dtc->LoadModels(base::Bind(&ModelAssociationManager::ModelLoadCallback,
174 weak_ptr_factory_.GetWeakPtr())); 173 weak_ptr_factory_.GetWeakPtr()));
175 } 174 }
176 } 175 }
177 NotifyDelegateIfReadyForConfigure(); 176 NotifyDelegateIfReadyForConfigure();
178 } 177 }
179 178
180 void ModelAssociationManager::StartAssociationAsync( 179 void ModelAssociationManager::StartAssociationAsync(
181 const ModelTypeSet& types_to_associate) { 180 const ModelTypeSet& types_to_associate) {
182 DCHECK_EQ(INITIALIZED, state_); 181 DCHECK_EQ(INITIALIZED, state_);
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 // At least one type is not ready. 408 // At least one type is not ready.
410 return; 409 return;
411 } 410 }
412 } 411 }
413 412
414 notified_about_ready_for_configure_ = true; 413 notified_about_ready_for_configure_ = true;
415 delegate_->OnAllDataTypesReadyForConfigure(); 414 delegate_->OnAllDataTypesReadyForConfigure();
416 } 415 }
417 416
418 } // namespace syncer 417 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/driver/model_association_manager.h ('k') | components/sync/driver/model_association_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698