| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/glue/data_type_manager_impl2.h" | 5 #include "chrome/browser/sync/glue/data_type_manager_impl2.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/sync/glue/data_type_controller.h" | 9 #include "chrome/browser/sync/glue/data_type_controller.h" |
| 10 #include "chrome/browser/sync/glue/sync_backend_host.h" | 10 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 return; | 179 return; |
| 180 } | 180 } |
| 181 | 181 |
| 182 state_ = CONFIGURING; | 182 state_ = CONFIGURING; |
| 183 StartNextType(); | 183 StartNextType(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void DataTypeManagerImpl2::StartNextType() { | 186 void DataTypeManagerImpl2::StartNextType() { |
| 187 // If there are any data types left to start, start the one at the | 187 // If there are any data types left to start, start the one at the |
| 188 // front of the list. | 188 // front of the list. |
| 189 if (needs_start_.size() > 0) { | 189 if (!needs_start_.empty()) { |
| 190 current_dtc_ = needs_start_[0]; | 190 current_dtc_ = needs_start_[0]; |
| 191 VLOG(1) << "Starting " << current_dtc_->name(); | 191 VLOG(1) << "Starting " << current_dtc_->name(); |
| 192 current_dtc_->Start( | 192 current_dtc_->Start( |
| 193 NewCallback(this, &DataTypeManagerImpl2::TypeStartCallback)); | 193 NewCallback(this, &DataTypeManagerImpl2::TypeStartCallback)); |
| 194 return; | 194 return; |
| 195 } | 195 } |
| 196 | 196 |
| 197 // If no more data types need starting, we're done. | 197 // If no more data types need starting, we're done. |
| 198 DCHECK_EQ(state_, CONFIGURING); | 198 DCHECK_EQ(state_, CONFIGURING); |
| 199 state_ = CONFIGURED; | 199 state_ = CONFIGURED; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 | 328 |
| 329 const DataTypeController::TypeMap& DataTypeManagerImpl2::controllers() { | 329 const DataTypeController::TypeMap& DataTypeManagerImpl2::controllers() { |
| 330 return controllers_; | 330 return controllers_; |
| 331 } | 331 } |
| 332 | 332 |
| 333 DataTypeManager::State DataTypeManagerImpl2::state() { | 333 DataTypeManager::State DataTypeManagerImpl2::state() { |
| 334 return state_; | 334 return state_; |
| 335 } | 335 } |
| 336 | 336 |
| 337 } // namespace browser_sync | 337 } // namespace browser_sync |
| OLD | NEW |