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

Side by Side 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: Rebase and 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_GLUE_NEW_NON_FRONTEND_DATA_TYPE_CONTROLLER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_NEW_NON_FRONTEND_DATA_TYPE_CONTROLLER_H_
7 #pragma once
8
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h"
11 #include "chrome/browser/sync/glue/shared_change_processor.h"
12
13 class SyncableService;
14
15 namespace sync_api {
16 struct UserShare;
17 }
18
19 namespace browser_sync {
20
21 class NewNonFrontendDataTypeController : public NonFrontendDataTypeController {
22 public:
23 NewNonFrontendDataTypeController(
24 ProfileSyncFactory* profile_sync_factory,
25 Profile* profile);
26 virtual ~NewNonFrontendDataTypeController();
27
28 virtual void Start(StartCallback* start_callback) OVERRIDE;
29 virtual void Stop() OVERRIDE;
30
31 protected:
32 NewNonFrontendDataTypeController();
33 virtual void StartAssociation() OVERRIDE;
34
35 // Extract/create the syncable service from the profile.
36 virtual SyncableService* GetSyncableService() const = 0;
37
38 // We make this static because it's possible the thread it gets posted to is
39 // blocked on I/O or similar and we don't want to block sync shutdown.
40 static void StopLocalService(
41 SyncableService* service, syncable::ModelType type);
42 // Posts StopLocalService to appropriate thread.
43 virtual bool StopLocalServiceAsync() = 0;
44
45 // Return this datatype's syncable service.
46 virtual SyncableService* local_service() const;
47
48 private:
49 // Deprecated.
50 virtual bool StopAssociationAsync() OVERRIDE;
51 virtual void CreateSyncComponents() OVERRIDE;
52
53 sync_api::UserShare* user_share_;
54
55 // A pointer to the actual local syncable service, which performs all the
56 // real work. We do not own the object.
57 SyncableService* local_service_;
58
59 scoped_refptr<SharedChangeProcessor> shared_change_processor_;
60 };
61
62 } // namespace browser_sync
63
64 #endif // CHROME_BROWSER_SYNC_GLUE_NEW_NON_FRONTEND_DATA_TYPE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698