| 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/ui_data_type_controller.h" | 5 #include "components/sync_driver/ui_data_type_controller.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/location.h" | 9 #include "base/location.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 10 #include "base/profiler/scoped_tracker.h" | 12 #include "base/profiler/scoped_tracker.h" |
| 11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 12 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
| 13 #include "components/sync_driver/generic_change_processor_factory.h" | 15 #include "components/sync_driver/generic_change_processor_factory.h" |
| 14 #include "components/sync_driver/shared_change_processor_ref.h" | 16 #include "components/sync_driver/shared_change_processor_ref.h" |
| 15 #include "components/sync_driver/sync_client.h" | 17 #include "components/sync_driver/sync_client.h" |
| 16 #include "components/sync_driver/sync_service.h" | 18 #include "components/sync_driver/sync_service.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 40 type_(type), | 42 type_(type), |
| 41 processor_factory_(new GenericChangeProcessorFactory()), | 43 processor_factory_(new GenericChangeProcessorFactory()), |
| 42 ui_thread_(ui_thread) { | 44 ui_thread_(ui_thread) { |
| 43 DCHECK(ui_thread_->BelongsToCurrentThread()); | 45 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 44 DCHECK(syncer::IsRealDataType(type_)); | 46 DCHECK(syncer::IsRealDataType(type_)); |
| 45 } | 47 } |
| 46 | 48 |
| 47 void UIDataTypeController::SetGenericChangeProcessorFactoryForTest( | 49 void UIDataTypeController::SetGenericChangeProcessorFactoryForTest( |
| 48 scoped_ptr<GenericChangeProcessorFactory> factory) { | 50 scoped_ptr<GenericChangeProcessorFactory> factory) { |
| 49 DCHECK_EQ(state_, NOT_RUNNING); | 51 DCHECK_EQ(state_, NOT_RUNNING); |
| 50 processor_factory_ = factory.Pass(); | 52 processor_factory_ = std::move(factory); |
| 51 } | 53 } |
| 52 | 54 |
| 53 UIDataTypeController::~UIDataTypeController() { | 55 UIDataTypeController::~UIDataTypeController() { |
| 54 DCHECK(ui_thread_->BelongsToCurrentThread()); | 56 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 55 } | 57 } |
| 56 | 58 |
| 57 void UIDataTypeController::LoadModels( | 59 void UIDataTypeController::LoadModels( |
| 58 const ModelLoadCallback& model_load_callback) { | 60 const ModelLoadCallback& model_load_callback) { |
| 59 DCHECK(ui_thread_->BelongsToCurrentThread()); | 61 DCHECK(ui_thread_->BelongsToCurrentThread()); |
| 60 DCHECK(syncer::IsRealDataType(type_)); | 62 DCHECK(syncer::IsRealDataType(type_)); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 ModelTypeToHistogramInt(type()), | 386 ModelTypeToHistogramInt(type()), |
| 385 syncer::MODEL_TYPE_COUNT); | 387 syncer::MODEL_TYPE_COUNT); |
| 386 #define PER_DATA_TYPE_MACRO(type_str) \ | 388 #define PER_DATA_TYPE_MACRO(type_str) \ |
| 387 UMA_HISTOGRAM_ENUMERATION("Sync." type_str "ConfigureFailure", result, \ | 389 UMA_HISTOGRAM_ENUMERATION("Sync." type_str "ConfigureFailure", result, \ |
| 388 MAX_CONFIGURE_RESULT); | 390 MAX_CONFIGURE_RESULT); |
| 389 SYNC_DATA_TYPE_HISTOGRAM(type()); | 391 SYNC_DATA_TYPE_HISTOGRAM(type()); |
| 390 #undef PER_DATA_TYPE_MACRO | 392 #undef PER_DATA_TYPE_MACRO |
| 391 } | 393 } |
| 392 | 394 |
| 393 } // namespace sync_driver | 395 } // namespace sync_driver |
| OLD | NEW |