OLD | NEW |
1 // Copyright 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/callback.h" | 10 #include "base/callback.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "sync/api/attachments/attachment_store.h" |
14 #include "sync/api/sync_change_processor.h" | 15 #include "sync/api/sync_change_processor.h" |
15 #include "sync/api/sync_data.h" | 16 #include "sync/api/sync_data.h" |
16 #include "sync/api/sync_error.h" | 17 #include "sync/api/sync_error.h" |
17 #include "sync/api/sync_merge_result.h" | 18 #include "sync/api/sync_merge_result.h" |
18 #include "sync/base/sync_export.h" | 19 #include "sync/base/sync_export.h" |
19 #include "sync/internal_api/public/base/model_type.h" | 20 #include "sync/internal_api/public/base/model_type.h" |
20 | 21 |
21 namespace syncer { | 22 namespace syncer { |
22 | 23 |
23 class SyncErrorFactory; | 24 class SyncErrorFactory; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 59 |
59 // SyncChangeProcessor interface. | 60 // SyncChangeProcessor interface. |
60 // Process a list of new SyncChanges and update the local data as necessary. | 61 // Process a list of new SyncChanges and update the local data as necessary. |
61 // Returns: A default SyncError (IsSet() == false) if no errors were | 62 // Returns: A default SyncError (IsSet() == false) if no errors were |
62 // encountered, and a filled SyncError (IsSet() == true) | 63 // encountered, and a filled SyncError (IsSet() == true) |
63 // otherwise. | 64 // otherwise. |
64 virtual SyncError ProcessSyncChanges( | 65 virtual SyncError ProcessSyncChanges( |
65 const tracked_objects::Location& from_here, | 66 const tracked_objects::Location& from_here, |
66 const SyncChangeList& change_list) OVERRIDE = 0; | 67 const SyncChangeList& change_list) OVERRIDE = 0; |
67 | 68 |
| 69 // Returns AttachmentStore used by datatype. Attachment store is used by sync |
| 70 // when uploading or downloading attachments. |
| 71 // GetAttachmentStore is called right before MergeDataAndStartSyncing. If at |
| 72 // that time GetAttachmentStore returns NULL then datatype is considered not |
| 73 // using attachments and all attempts to upload/download attachments will |
| 74 // fail. Default implementation returns NULL. Datatype that uses sync |
| 75 // attachemnts should create attachment store and implement GetAttachmentStore |
| 76 // to return pointer to it. |
| 77 virtual scoped_refptr<AttachmentStore> GetAttachmentStore(); |
| 78 |
68 protected: | 79 protected: |
69 virtual ~SyncableService(); | 80 virtual ~SyncableService(); |
70 }; | 81 }; |
71 | 82 |
72 } // namespace syncer | 83 } // namespace syncer |
73 | 84 |
74 #endif // SYNC_API_SYNCABLE_SERVICE_H_ | 85 #endif // SYNC_API_SYNCABLE_SERVICE_H_ |
OLD | NEW |