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

Unified Diff: components/sync/driver/ui_data_type_controller.h

Issue 2289143003: [Sync] Convert DTCs to be not RefCounted and NonThreadSafe. (Closed)
Patch Set: Rebase. Created 4 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/sync_service.h ('k') | components/sync/driver/ui_data_type_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/ui_data_type_controller.h
diff --git a/components/sync/driver/ui_data_type_controller.h b/components/sync/driver/ui_data_type_controller.h
index d3d099c9cfa73ace07581b9af97b98e1ddaea9eb..cb4b3cd81c050e80d591793d612d9e531f13aa79 100644
--- a/components/sync/driver/ui_data_type_controller.h
+++ b/components/sync/driver/ui_data_type_controller.h
@@ -33,26 +33,21 @@ namespace sync_driver {
// Note: RefCountedThreadSafe by way of DataTypeController.
class UIDataTypeController : public DirectoryDataTypeController {
public:
- UIDataTypeController(
- const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
- const base::Closure& error_callback,
- syncer::ModelType type,
- SyncClient* sync_client);
+ // |dump_stack| is called when an unrecoverable error occurs.
+ UIDataTypeController(syncer::ModelType type,
+ const base::Closure& dump_stack,
+ SyncClient* sync_client);
+ ~UIDataTypeController() override;
// DataTypeController interface.
void LoadModels(const ModelLoadCallback& model_load_callback) override;
void StartAssociating(const StartCallback& start_callback) override;
void Stop() override;
- syncer::ModelType type() const override;
syncer::ModelSafeGroup model_safe_group() const override;
ChangeProcessor* GetChangeProcessor() const override;
std::string name() const override;
State state() const override;
- // DataTypeErrorHandler interface.
- void OnSingleDataTypeUnrecoverableError(
- const syncer::SyncError& error) override;
-
// Used by tests to override the factory used to create
// GenericChangeProcessors.
void SetGenericChangeProcessorFactoryForTest(
@@ -61,8 +56,6 @@ class UIDataTypeController : public DirectoryDataTypeController {
protected:
// For testing only.
UIDataTypeController();
- // DataTypeController is RefCounted.
- ~UIDataTypeController() override;
// Start any dependent services that need to be running before we can
// associate models. The default implementation is a no-op.
@@ -91,14 +84,13 @@ class UIDataTypeController : public DirectoryDataTypeController {
// us know that it is safe to start associating.
void OnModelLoaded();
+ std::unique_ptr<syncer::DataTypeErrorHandler> CreateErrorHandler() override;
+
State state_;
StartCallback start_callback_;
ModelLoadCallback model_load_callback_;
- // The sync datatype being controlled.
- syncer::ModelType type_;
-
// Sync's interface to the datatype. All sync changes for |type_| are pushed
// through it to the datatype as well as vice versa.
//
@@ -122,14 +114,14 @@ class UIDataTypeController : public DirectoryDataTypeController {
// real work. We do not own the object.
base::WeakPtr<syncer::SyncableService> local_service_;
- scoped_refptr<base::SingleThreadTaskRunner> ui_thread_;
-
private:
// Associate the sync model with the service's model, then start syncing.
virtual void Associate();
virtual void AbortModelLoad();
+ void OnUnrecoverableError(const syncer::SyncError& error);
+
DISALLOW_COPY_AND_ASSIGN(UIDataTypeController);
};
« no previous file with comments | « components/sync/driver/sync_service.h ('k') | components/sync/driver/ui_data_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698