Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Unified Diff: components/sync_driver/non_ui_data_type_controller.cc

Issue 1314903004: Sync: Refactoring DataTypeController to make the design shareable with USS datatypes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync_driver/non_ui_data_type_controller.cc
diff --git a/components/sync_driver/non_ui_data_type_controller.cc b/components/sync_driver/non_ui_data_type_controller.cc
index ac180f613a4725d38d6997caf0860da69f371fa1..bf339fa646776bc9b4a7cc3b8531e6564622f744 100644
--- a/components/sync_driver/non_ui_data_type_controller.cc
+++ b/components/sync_driver/non_ui_data_type_controller.cc
@@ -10,7 +10,10 @@
#include "components/sync_driver/generic_change_processor_factory.h"
#include "components/sync_driver/shared_change_processor_ref.h"
#include "components/sync_driver/sync_api_component_factory.h"
+#include "components/sync_driver/sync_client.h"
+#include "components/sync_driver/sync_service.h"
#include "sync/api/sync_error.h"
+#include "sync/api/sync_merge_result.h"
#include "sync/api/syncable_service.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/util/data_type_histogram.h"
@@ -23,14 +26,13 @@ NonUIDataTypeController::CreateSharedChangeProcessor() {
}
NonUIDataTypeController::NonUIDataTypeController(
- scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
+ const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
const base::Closure& error_callback,
SyncClient* sync_client)
- : DataTypeController(ui_thread, error_callback),
+ : DirectoryDataTypeController(ui_thread, error_callback),
sync_client_(sync_client),
state_(NOT_RUNNING),
- ui_thread_(ui_thread) {
-}
+ ui_thread_(ui_thread) {}
void NonUIDataTypeController::LoadModels(
const ModelLoadCallback& model_load_callback) {
@@ -172,7 +174,8 @@ void NonUIDataTypeController::OnSingleDataTypeUnrecoverableError(
}
NonUIDataTypeController::NonUIDataTypeController()
- : DataTypeController(base::ThreadTaskRunnerHandle::Get(), base::Closure()),
+ : DirectoryDataTypeController(base::ThreadTaskRunnerHandle::Get(),
+ base::Closure()),
sync_client_(NULL) {}
NonUIDataTypeController::~NonUIDataTypeController() {}
@@ -305,13 +308,10 @@ void NonUIDataTypeController::
// disconnected at this point, so all our accesses to the syncer from this
// point on are through it.
GenericChangeProcessorFactory factory;
+ DCHECK(sync_client_->GetSyncService());
local_service_ = shared_change_processor->Connect(
- sync_client_,
- &factory,
- user_share(),
- this,
- type(),
- weak_ptr_factory.GetWeakPtr());
+ sync_client_, &factory, sync_client_->GetSyncService()->GetUserShare(),
+ this, type(), weak_ptr_factory.GetWeakPtr());
if (!local_service_.get()) {
syncer::SyncError error(FROM_HERE,
syncer::SyncError::DATATYPE_ERROR,
« no previous file with comments | « components/sync_driver/non_ui_data_type_controller.h ('k') | components/sync_driver/non_ui_data_type_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698