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

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: 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/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..67aa41ae82c79ba81869298b7208315e66caea22
--- /dev/null
+++ b/components/sync_driver/directory_data_type_controller.h
@@ -0,0 +1,43 @@
+// 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:
+ // Activates this controller's data type.
Nicolas Zea 2015/09/02 22:52:45 nit: would be good to explain a bit more about wha
stanisc 2015/09/03 01:17:42 Provided a bit more detailed comments here and in
+ void ActivateDataType(BackendDataTypeConfigurer* configurer) override;
+
+ // Deactivates this controller's data type.
+ 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(
+ scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
Nicolas Zea 2015/09/02 22:52:45 nit: pass scoped_refptrs by const ref ("const scop
stanisc 2015/09/03 01:17:42 OK, changed here and in derived classes.
+ const base::Closure& error_callback);
+
+ ~DirectoryDataTypeController() override;
+};
+
+} // namespace sync_driver
+
+#endif // COMPONENTS_SYNC_DRIVER_DIRECTORY_DATA_TYPE_CONTROLLER_H__

Powered by Google App Engine
This is Rietveld 408576698