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

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: 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/generic_change_processor.h"
11 #include "chrome/browser/sync/glue/non_frontend_data_type_controller.h"
12
13 class SyncableService;
14
15 namespace sync_api {
16 struct UserShare;
17 }
18
19 namespace browser_sync {
20
21 class GenericChangeProcessor;
22
23 class NewNonFrontendDataTypeController : public NonFrontendDataTypeController {
24 public:
25 NewNonFrontendDataTypeController(
26 ProfileSyncFactory* profile_sync_factory,
27 Profile* profile);
28 virtual ~NewNonFrontendDataTypeController();
29
30 virtual void Start(StartCallback* start_callback) OVERRIDE;
31 virtual void Stop() OVERRIDE;
32
33 protected:
34 NewNonFrontendDataTypeController();
35 virtual void StartAssociation() OVERRIDE;
36
37 // Extract/create the syncable service from the profile.
38 virtual SyncableService* GetSyncableService() const = 0;
39
40 // We make this static because it's possible the thread it gets posted to is
41 // blocked on I/O or similar and we don't want to block sync shutdown.
42 static void StopLocalService(
43 SyncableService* service, syncable::ModelType type);
44 // Posts StopLocalService to appropriate thread.
45 virtual bool StopLocalServiceAsync() = 0;
46
47 // Return this datatype's syncable service.
48 virtual SyncableService* local_service() const;
49
50 private:
51 // Deprecated.
52 virtual bool StopAssociationAsync() OVERRIDE;
53 virtual void CreateSyncComponents() OVERRIDE;
54
55 sync_api::UserShare* user_share_;
56
57 // A pointer to the actual local syncable service, which performs all the
58 // real work. We do not own the object.
59 SyncableService* local_service_;
60
61 scoped_refptr<GenericChangeProcessor> generic_change_processor_;
62 };
63
64 } // namespace browser_sync
65
66 #endif // CHROME_BROWSER_SYNC_GLUE_NEW_NON_FRONTEND_DATA_TYPE_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698