| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <functional> | 6 #include <functional> |
| 7 | 7 |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 namespace browser_sync { | 30 namespace browser_sync { |
| 31 // The amount of time we wait for a datatype to load. If the type has | 31 // The amount of time we wait for a datatype to load. If the type has |
| 32 // not finished loading we move on to the next type. Once this type | 32 // not finished loading we move on to the next type. Once this type |
| 33 // finishes loading we will do a configure to associate this type. Note | 33 // finishes loading we will do a configure to associate this type. Note |
| 34 // that in most cases types finish loading before this timeout. | 34 // that in most cases types finish loading before this timeout. |
| 35 const int64 kDataTypeLoadWaitTimeInSeconds = 120; | 35 const int64 kDataTypeLoadWaitTimeInSeconds = 120; |
| 36 namespace { | 36 namespace { |
| 37 | 37 |
| 38 static const syncable::ModelType kStartOrder[] = { | 38 static const syncable::ModelType kStartOrder[] = { |
| 39 syncable::NIGORI, // Listed for completeness. | 39 syncable::NIGORI, // Listed for completeness. |
| 40 syncable::BOOKMARKS, | 40 syncable::BOOKMARKS, // UI thread datatypes. |
| 41 syncable::PREFERENCES, | 41 syncable::PREFERENCES, |
| 42 syncable::AUTOFILL, | |
| 43 syncable::AUTOFILL_PROFILE, | |
| 44 syncable::EXTENSION_SETTINGS, | |
| 45 syncable::EXTENSIONS, | 42 syncable::EXTENSIONS, |
| 46 syncable::APP_SETTINGS, | |
| 47 syncable::APPS, | 43 syncable::APPS, |
| 48 syncable::THEMES, | 44 syncable::THEMES, |
| 49 syncable::TYPED_URLS, | |
| 50 syncable::PASSWORDS, | |
| 51 syncable::SEARCH_ENGINES, | 45 syncable::SEARCH_ENGINES, |
| 52 syncable::SESSIONS, | 46 syncable::SESSIONS, |
| 53 syncable::APP_NOTIFICATIONS, | 47 syncable::APP_NOTIFICATIONS, |
| 48 syncable::AUTOFILL, // Non-UI thread datatypes. |
| 49 syncable::AUTOFILL_PROFILE, |
| 50 syncable::EXTENSION_SETTINGS, |
| 51 syncable::APP_SETTINGS, |
| 52 syncable::TYPED_URLS, |
| 53 syncable::PASSWORDS, |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 COMPILE_ASSERT(arraysize(kStartOrder) == | 56 COMPILE_ASSERT(arraysize(kStartOrder) == |
| 57 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, | 57 syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, |
| 58 kStartOrder_IncorrectSize); | 58 kStartOrder_IncorrectSize); |
| 59 | 59 |
| 60 // Comparator used when sorting data type controllers. | 60 // Comparator used when sorting data type controllers. |
| 61 class SortComparator : public std::binary_function<DataTypeController*, | 61 class SortComparator : public std::binary_function<DataTypeController*, |
| 62 DataTypeController*, | 62 DataTypeController*, |
| 63 bool> { | 63 bool> { |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 return result; | 494 return result; |
| 495 } | 495 } |
| 496 | 496 |
| 497 base::OneShotTimer<ModelAssociationManager>* | 497 base::OneShotTimer<ModelAssociationManager>* |
| 498 ModelAssociationManager::GetTimerForTesting() { | 498 ModelAssociationManager::GetTimerForTesting() { |
| 499 return &timer_; | 499 return &timer_; |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace browser_sync | 502 } // namespace browser_sync |
| 503 | 503 |
| OLD | NEW |