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_impl.h" | 5 #include "chrome/browser/sync/glue/data_type_manager_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 syncable::NIGORI, // Listed for completeness. | 26 syncable::NIGORI, // Listed for completeness. |
27 syncable::BOOKMARKS, | 27 syncable::BOOKMARKS, |
28 syncable::PREFERENCES, | 28 syncable::PREFERENCES, |
29 syncable::AUTOFILL, | 29 syncable::AUTOFILL, |
30 syncable::AUTOFILL_PROFILE, | 30 syncable::AUTOFILL_PROFILE, |
31 syncable::EXTENSIONS, | 31 syncable::EXTENSIONS, |
32 syncable::APPS, | 32 syncable::APPS, |
33 syncable::THEMES, | 33 syncable::THEMES, |
34 syncable::TYPED_URLS, | 34 syncable::TYPED_URLS, |
35 syncable::PASSWORDS, | 35 syncable::PASSWORDS, |
| 36 syncable::SEARCH_ENGINES, |
36 syncable::SESSIONS, | 37 syncable::SESSIONS, |
37 }; | 38 }; |
38 | 39 |
39 COMPILE_ASSERT(arraysize(kStartOrder) == | 40 COMPILE_ASSERT(arraysize(kStartOrder) == |
40 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, | 41 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, |
41 kStartOrder_IncorrectSize); | 42 kStartOrder_IncorrectSize); |
42 | 43 |
43 // Comparator used when sorting data type controllers. | 44 // Comparator used when sorting data type controllers. |
44 class SortComparator : public std::binary_function<DataTypeController*, | 45 class SortComparator : public std::binary_function<DataTypeController*, |
45 DataTypeController*, | 46 DataTypeController*, |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 return; | 279 return; |
279 } | 280 } |
280 | 281 |
281 // We're done with the data type at the head of the list -- remove it. | 282 // We're done with the data type at the head of the list -- remove it. |
282 DataTypeController* started_dtc = needs_start_[0]; | 283 DataTypeController* started_dtc = needs_start_[0]; |
283 DCHECK(needs_start_.size()); | 284 DCHECK(needs_start_.size()); |
284 DCHECK_EQ(needs_start_[0], started_dtc); | 285 DCHECK_EQ(needs_start_[0], started_dtc); |
285 needs_start_.erase(needs_start_.begin()); | 286 needs_start_.erase(needs_start_.begin()); |
286 | 287 |
287 if (result == DataTypeController::NEEDS_CRYPTO) { | 288 if (result == DataTypeController::NEEDS_CRYPTO) { |
288 | |
289 } | 289 } |
290 // If the type started normally, continue to the next type. | 290 // If the type started normally, continue to the next type. |
291 // If the type is waiting for the cryptographer, continue to the next type. | 291 // If the type is waiting for the cryptographer, continue to the next type. |
292 // Once the cryptographer is ready, we'll attempt to restart this type. | 292 // Once the cryptographer is ready, we'll attempt to restart this type. |
293 if (result == DataTypeController::NEEDS_CRYPTO || | 293 if (result == DataTypeController::NEEDS_CRYPTO || |
294 result == DataTypeController::OK || | 294 result == DataTypeController::OK || |
295 result == DataTypeController::OK_FIRST_RUN) { | 295 result == DataTypeController::OK_FIRST_RUN) { |
296 StartNextType(); | 296 StartNextType(); |
297 return; | 297 return; |
298 } | 298 } |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 Source<DataTypeManager>(this), | 438 Source<DataTypeManager>(this), |
439 NotificationService::NoDetails()); | 439 NotificationService::NoDetails()); |
440 } | 440 } |
441 | 441 |
442 void DataTypeManagerImpl::AddToConfigureTime() { | 442 void DataTypeManagerImpl::AddToConfigureTime() { |
443 DCHECK(!last_restart_time_.is_null()); | 443 DCHECK(!last_restart_time_.is_null()); |
444 configure_time_delta_ += (base::Time::Now() - last_restart_time_); | 444 configure_time_delta_ += (base::Time::Now() - last_restart_time_); |
445 } | 445 } |
446 | 446 |
447 } // namespace browser_sync | 447 } // namespace browser_sync |
OLD | NEW |