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

Unified Diff: components/sync_driver/directory_data_type_controller.h

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/directory_data_type_controller.h
diff --git a/components/sync_driver/directory_data_type_controller.h b/components/sync_driver/directory_data_type_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..0ec30811405072c00d6be379584ddd3757633842
--- /dev/null
+++ b/components/sync_driver/directory_data_type_controller.h
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SYNC_DRIVER_DIRECTORY_DATA_TYPE_CONTROLLER_H__
+#define COMPONENTS_SYNC_DRIVER_DIRECTORY_DATA_TYPE_CONTROLLER_H__
+
+#include "components/sync_driver/data_type_controller.h"
+
+#include "sync/internal_api/public/engine/model_safe_worker.h"
+
+namespace sync_driver {
+class ChangeProcessor;
+
+// Base class for Directory based Data type controllers.
+class DirectoryDataTypeController : public DataTypeController {
+ public:
+ // Directory specific implementation of ActivateDataType with the
+ // type specific ChangeProcessor and ModelSafeGroup.
+ // Activates change processing on the controlled data type.
+ // This is called by DataTypeManager, synchronously with data type's
+ // model association.
+ // See BackendDataTypeConfigurer::ActivateDataType for more details.
+ void ActivateDataType(BackendDataTypeConfigurer* configurer) override;
+
+ // Directory specific implementation of DeactivateDataType.
+ // Deactivates change processing on the controlled data type (by removing
+ // the data type's ChangeProcessor registration with the backend).
+ // See BackendDataTypeConfigurer::DeactivateDataType for more details.
+ void DeactivateDataType(BackendDataTypeConfigurer* configurer) override;
+
+ protected:
+ // The model safe group of this data type. This should reflect the
+ // thread that should be used to modify the data type's native
+ // model.
+ virtual syncer::ModelSafeGroup model_safe_group() const = 0;
+
+ // Access to the ChangeProcessor for the type being controlled by |this|.
+ // Returns NULL if the ChangeProcessor isn't created or connected.
+ virtual ChangeProcessor* GetChangeProcessor() const = 0;
+
+ DirectoryDataTypeController(
+ const scoped_refptr<base::SingleThreadTaskRunner>& ui_thread,
+ const base::Closure& error_callback);
+
+ ~DirectoryDataTypeController() override;
+};
+
+} // namespace sync_driver
+
+#endif // COMPONENTS_SYNC_DRIVER_DIRECTORY_DATA_TYPE_CONTROLLER_H__
« no previous file with comments | « components/sync_driver/data_type_manager_impl_unittest.cc ('k') | components/sync_driver/directory_data_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698