| OLD | NEW |
| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 | 9 |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 syncer::DICTIONARY, | 54 syncer::DICTIONARY, |
| 55 syncer::FAVICON_IMAGES, | 55 syncer::FAVICON_IMAGES, |
| 56 syncer::FAVICON_TRACKING, | 56 syncer::FAVICON_TRACKING, |
| 57 syncer::SUPERVISED_USER_SETTINGS, | 57 syncer::SUPERVISED_USER_SETTINGS, |
| 58 syncer::SUPERVISED_USER_SHARED_SETTINGS, | 58 syncer::SUPERVISED_USER_SHARED_SETTINGS, |
| 59 syncer::SUPERVISED_USER_WHITELISTS, | 59 syncer::SUPERVISED_USER_WHITELISTS, |
| 60 syncer::ARTICLES, | 60 syncer::ARTICLES, |
| 61 syncer::WIFI_CREDENTIALS, | 61 syncer::WIFI_CREDENTIALS, |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 COMPILE_ASSERT(arraysize(kStartOrder) == | 64 static_assert(arraysize(kStartOrder) == |
| 65 syncer::MODEL_TYPE_COUNT - syncer::FIRST_REAL_MODEL_TYPE, | 65 syncer::MODEL_TYPE_COUNT - syncer::FIRST_REAL_MODEL_TYPE, |
| 66 kStartOrder_IncorrectSize); | 66 "kStartOrder must have MODEL_TYPE_COUNT - " |
| 67 "FIRST_REAL_MODEL_TYPE elements"); |
| 67 | 68 |
| 68 // The amount of time we wait for association to finish. If some types haven't | 69 // The amount of time we wait for association to finish. If some types haven't |
| 69 // finished association by the time, DataTypeManager is notified of the | 70 // finished association by the time, DataTypeManager is notified of the |
| 70 // unfinished types. | 71 // unfinished types. |
| 71 const int64 kAssociationTimeOutInSeconds = 600; | 72 const int64 kAssociationTimeOutInSeconds = 600; |
| 72 | 73 |
| 73 syncer::DataTypeAssociationStats BuildAssociationStatsFromMergeResults( | 74 syncer::DataTypeAssociationStats BuildAssociationStatsFromMergeResults( |
| 74 const syncer::SyncMergeResult& local_merge_result, | 75 const syncer::SyncMergeResult& local_merge_result, |
| 75 const syncer::SyncMergeResult& syncer_merge_result, | 76 const syncer::SyncMergeResult& syncer_merge_result, |
| 76 const base::TimeDelta& association_wait_time, | 77 const base::TimeDelta& association_wait_time, |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 411 |
| 411 delegate_->OnModelAssociationDone(result); | 412 delegate_->OnModelAssociationDone(result); |
| 412 } | 413 } |
| 413 | 414 |
| 414 base::OneShotTimer<ModelAssociationManager>* | 415 base::OneShotTimer<ModelAssociationManager>* |
| 415 ModelAssociationManager::GetTimerForTesting() { | 416 ModelAssociationManager::GetTimerForTesting() { |
| 416 return &timer_; | 417 return &timer_; |
| 417 } | 418 } |
| 418 | 419 |
| 419 } // namespace sync_driver | 420 } // namespace sync_driver |
| OLD | NEW |