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

Unified Diff: chrome/browser/sync/glue/new_non_frontend_data_type_controller.h

Issue 8065016: [Sync] Refactor non-frontend DTC to handle new API properly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 9 years, 2 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: chrome/browser/sync/glue/new_non_frontend_data_type_controller.h
diff --git a/chrome/browser/sync/glue/new_non_frontend_data_type_controller.h b/chrome/browser/sync/glue/new_non_frontend_data_type_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..031889944c3315347c5703b504ef509ddeb57f2e
--- /dev/null
+++ b/chrome/browser/sync/glue/new_non_frontend_data_type_controller.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2011 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 CHROME_BROWSER_SYNC_GLUE_NEW_NON_FRONTEND_DATA_TYPE_CONTROLLER_H_
+#define CHROME_BROWSER_SYNC_GLUE_NEW_NON_FRONTEND_DATA_TYPE_CONTROLLER_H_
+#pragma once
+
+#include "base/compiler_specific.h"
+#include "chrome/browser/sync/glue/generic_change_processor.h"
+#include "chrome/browser/sync/glue/non_frontend_data_type_controller.h"
+
+class SyncableService;
+
+namespace sync_api {
+struct UserShare;
+}
+
+namespace browser_sync {
+
+class GenericChangeProcessor;
+
+class NewNonFrontendDataTypeController : public NonFrontendDataTypeController {
+ public:
+ NewNonFrontendDataTypeController(
+ ProfileSyncFactory* profile_sync_factory,
+ Profile* profile);
+ virtual ~NewNonFrontendDataTypeController();
+
+ virtual void Start(StartCallback* start_callback) OVERRIDE;
+ virtual void Stop() OVERRIDE;
+
+ protected:
+ NewNonFrontendDataTypeController();
+ virtual void StartAssociation() OVERRIDE;
+
+ // Extract/create the syncable service from the profile.
+ virtual SyncableService* GetSyncableService() const = 0;
+
+ // We make this static because it's possible the thread it gets posted to is
+ // blocked on I/O or similar and we don't want to block sync shutdown.
+ static void StopLocalService(
+ SyncableService* service, syncable::ModelType type);
+ // Posts StopLocalService to appropriate thread.
+ virtual bool StopLocalServiceAsync() = 0;
+
+ // Return this datatype's syncable service.
+ virtual SyncableService* local_service() const;
+
+ private:
+ // Deprecated.
+ virtual bool StopAssociationAsync() OVERRIDE;
+ virtual void CreateSyncComponents() OVERRIDE;
+
+ sync_api::UserShare* user_share_;
+
+ // A pointer to the actual local syncable service, which performs all the
+ // real work. We do not own the object.
+ SyncableService* local_service_;
+
+ scoped_refptr<GenericChangeProcessor> generic_change_processor_;
+};
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_GLUE_NEW_NON_FRONTEND_DATA_TYPE_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698