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 "chrome/browser/sync/glue/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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "content/public/browser/browser_thread.h" | |
15 #include "sync/internal_api/public/base/model_type.h" | 14 #include "sync/internal_api/public/base/model_type.h" |
16 | 15 |
17 using content::BrowserThread; | |
18 using syncer::ModelTypeSet; | 16 using syncer::ModelTypeSet; |
19 | 17 |
20 namespace browser_sync { | 18 namespace browser_sync { |
21 | 19 |
22 namespace { | 20 namespace { |
23 | 21 |
24 static const syncer::ModelType kStartOrder[] = { | 22 static const syncer::ModelType kStartOrder[] = { |
25 syncer::NIGORI, // Listed for completeness. | 23 syncer::NIGORI, // Listed for completeness. |
26 syncer::DEVICE_INFO, // Listed for completeness. | 24 syncer::DEVICE_INFO, // Listed for completeness. |
27 syncer::EXPERIMENTS, // Listed for completeness. | 25 syncer::EXPERIMENTS, // Listed for completeness. |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 type, base::TimeTicks::Now())); | 327 type, base::TimeTicks::Now())); |
330 } | 328 } |
331 } | 329 } |
332 | 330 |
333 void ModelAssociationManager::TypeStartCallback( | 331 void ModelAssociationManager::TypeStartCallback( |
334 syncer::ModelType type, | 332 syncer::ModelType type, |
335 base::TimeTicks type_start_time, | 333 base::TimeTicks type_start_time, |
336 DataTypeController::StartResult start_result, | 334 DataTypeController::StartResult start_result, |
337 const syncer::SyncMergeResult& local_merge_result, | 335 const syncer::SyncMergeResult& local_merge_result, |
338 const syncer::SyncMergeResult& syncer_merge_result) { | 336 const syncer::SyncMergeResult& syncer_merge_result) { |
339 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
blundell
2014/02/01 13:18:32
Do you think it's worth preserving this DCHECK by
Nicolas Zea
2014/02/03 19:21:36
Removing it is fine, all these classes are UI thre
| |
340 | |
341 // TODO(haitaol): temporary fix for 335606. | 337 // TODO(haitaol): temporary fix for 335606. |
342 if (slow_types_.Has(type)) | 338 if (slow_types_.Has(type)) |
343 return; | 339 return; |
344 | 340 |
345 // This happens when slow associating type is disabled by new configuration. | 341 // This happens when slow associating type is disabled by new configuration. |
346 if (!desired_types_.Has(type)) | 342 if (!desired_types_.Has(type)) |
347 return; | 343 return; |
348 | 344 |
349 slow_types_.Remove(type); | 345 slow_types_.Remove(type); |
350 | 346 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
451 | 447 |
452 result_processor_->OnModelAssociationDone(result); | 448 result_processor_->OnModelAssociationDone(result); |
453 } | 449 } |
454 | 450 |
455 base::OneShotTimer<ModelAssociationManager>* | 451 base::OneShotTimer<ModelAssociationManager>* |
456 ModelAssociationManager::GetTimerForTesting() { | 452 ModelAssociationManager::GetTimerForTesting() { |
457 return &timer_; | 453 return &timer_; |
458 } | 454 } |
459 | 455 |
460 } // namespace browser_sync | 456 } // namespace browser_sync |
OLD | NEW |