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

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: Fixing build on Android Created 5 years, 4 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..0e1c8cfd0f5b04a5ecda0767a4f0ebc8a06fa5b8 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"
@@ -26,11 +29,10 @@ NonUIDataTypeController::NonUIDataTypeController(
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,

Powered by Google App Engine
This is Rietveld 408576698