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

Unified Diff: components/sync_driver/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
« no previous file with comments | « components/sync_driver/ui_data_type_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_driver/ui_data_type_controller.cc
diff --git a/components/sync_driver/ui_data_type_controller.cc b/components/sync_driver/ui_data_type_controller.cc
index 1d0aca773e6cb42e24ece8252042d8b516c029be..17eee9b0dc1b058abce828aa74d715b3e52f88b0 100644
--- a/components/sync_driver/ui_data_type_controller.cc
+++ b/components/sync_driver/ui_data_type_controller.cc
@@ -13,7 +13,9 @@
#include "components/sync_driver/generic_change_processor_factory.h"
#include "components/sync_driver/shared_change_processor_ref.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"
@@ -21,19 +23,18 @@
namespace sync_driver {
UIDataTypeController::UIDataTypeController()
- : DataTypeController(base::ThreadTaskRunnerHandle::Get(),
- base::Closure()),
+ : DirectoryDataTypeController(base::ThreadTaskRunnerHandle::Get(),
+ base::Closure()),
sync_client_(NULL),
state_(NOT_RUNNING),
- type_(syncer::UNSPECIFIED) {
-}
+ type_(syncer::UNSPECIFIED) {}
UIDataTypeController::UIDataTypeController(
- scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
+ const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
const base::Closure& error_callback,
syncer::ModelType type,
SyncClient* sync_client)
- : DataTypeController(ui_thread, error_callback),
+ : DirectoryDataTypeController(ui_thread, error_callback),
sync_client_(sync_client),
state_(NOT_RUNNING),
type_(type),
@@ -131,12 +132,10 @@ void UIDataTypeController::Associate() {
// Connect |shared_change_processor_| to the syncer and get the
// syncer::SyncableService associated with type().
+ DCHECK(sync_client_->GetSyncService());
local_service_ = shared_change_processor_->Connect(
- sync_client_,
- processor_factory_.get(),
- user_share(),
- this,
- type(),
+ sync_client_, processor_factory_.get(),
+ sync_client_->GetSyncService()->GetUserShare(), this, type(),
weak_ptr_factory.GetWeakPtr());
if (!local_service_.get()) {
syncer::SyncError error(FROM_HERE,
« no previous file with comments | « components/sync_driver/ui_data_type_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698