OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SYNC_API_SYNCABLE_SERVICE_H_ | 5 #ifndef SYNC_API_SYNCABLE_SERVICE_H_ |
6 #define SYNC_API_SYNCABLE_SERVICE_H_ | 6 #define SYNC_API_SYNCABLE_SERVICE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "sync/api/sync_change_processor.h" | 13 #include "sync/api/sync_change_processor.h" |
14 #include "sync/api/sync_data.h" | 14 #include "sync/api/sync_data.h" |
15 #include "sync/api/sync_error.h" | 15 #include "sync/api/sync_error.h" |
16 #include "sync/api/sync_merge_result.h" | 16 #include "sync/api/sync_merge_result.h" |
| 17 #include "sync/base/sync_export.h" |
17 #include "sync/internal_api/public/base/model_type.h" | 18 #include "sync/internal_api/public/base/model_type.h" |
18 | 19 |
19 namespace syncer { | 20 namespace syncer { |
20 | 21 |
21 class SyncErrorFactory; | 22 class SyncErrorFactory; |
22 | 23 |
23 typedef std::vector<SyncData> SyncDataList; | 24 typedef std::vector<SyncData> SyncDataList; |
24 | 25 |
25 // TODO(zea): remove SupportsWeakPtr in favor of having all SyncableService | 26 // TODO(zea): remove SupportsWeakPtr in favor of having all SyncableService |
26 // implementers provide a way of getting a weak pointer to themselves. | 27 // implementers provide a way of getting a weak pointer to themselves. |
27 // See crbug.com/100114. | 28 // See crbug.com/100114. |
28 class SyncableService : public SyncChangeProcessor, | 29 class SYNC_EXPORT SyncableService |
29 public base::SupportsWeakPtr<SyncableService> { | 30 : public SyncChangeProcessor, |
| 31 public base::SupportsWeakPtr<SyncableService> { |
30 public: | 32 public: |
31 // Informs the service to begin syncing the specified synced datatype |type|. | 33 // Informs the service to begin syncing the specified synced datatype |type|. |
32 // The service should then merge |initial_sync_data| into it's local data, | 34 // The service should then merge |initial_sync_data| into it's local data, |
33 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the | 35 // calling |sync_processor|'s ProcessSyncChanges as necessary to reconcile the |
34 // two. After this, the SyncableService's local data should match the server | 36 // two. After this, the SyncableService's local data should match the server |
35 // data, and the service should be ready to receive and process any further | 37 // data, and the service should be ready to receive and process any further |
36 // SyncChange's as they occur. | 38 // SyncChange's as they occur. |
37 // Returns: a SyncMergeResult whose error field reflects whether an error | 39 // Returns: a SyncMergeResult whose error field reflects whether an error |
38 // was encountered while merging the two models. The merge result | 40 // was encountered while merging the two models. The merge result |
39 // may also contain optional merge statistics. | 41 // may also contain optional merge statistics. |
(...skipping 20 matching lines...) Expand all Loading... |
60 const tracked_objects::Location& from_here, | 62 const tracked_objects::Location& from_here, |
61 const SyncChangeList& change_list) OVERRIDE = 0; | 63 const SyncChangeList& change_list) OVERRIDE = 0; |
62 | 64 |
63 protected: | 65 protected: |
64 virtual ~SyncableService(); | 66 virtual ~SyncableService(); |
65 }; | 67 }; |
66 | 68 |
67 } // namespace syncer | 69 } // namespace syncer |
68 | 70 |
69 #endif // SYNC_API_SYNCABLE_SERVICE_H_ | 71 #endif // SYNC_API_SYNCABLE_SERVICE_H_ |
OLD | NEW |