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" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 // otherwise. | 65 // otherwise. |
66 SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, | 66 SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, |
67 const SyncChangeList& change_list) override = 0; | 67 const SyncChangeList& change_list) override = 0; |
68 | 68 |
69 // Returns AttachmentStore used by datatype. Attachment store is used by sync | 69 // Returns AttachmentStore used by datatype. Attachment store is used by sync |
70 // when uploading or downloading attachments. | 70 // when uploading or downloading attachments. |
71 // GetAttachmentStore is called right before MergeDataAndStartSyncing. If at | 71 // GetAttachmentStore is called right before MergeDataAndStartSyncing. If at |
72 // that time GetAttachmentStore returns NULL then datatype is considered not | 72 // that time GetAttachmentStore returns NULL then datatype is considered not |
73 // using attachments and all attempts to upload/download attachments will | 73 // using attachments and all attempts to upload/download attachments will |
74 // fail. Default implementation returns NULL. Datatype that uses sync | 74 // fail. Default implementation returns NULL. Datatype that uses sync |
75 // attachemnts should create attachment store and implement GetAttachmentStore | 75 // attachments should create attachment store and implement GetAttachmentStore |
76 // to return pointer to it. | 76 // to return pointer to it. |
77 virtual scoped_refptr<AttachmentStore> GetAttachmentStore(); | 77 virtual AttachmentStore* GetAttachmentStore(); |
maniscalco
2015/03/06 23:15:03
As we talked about in person, it would be great if
pavely
2015/03/09 18:09:29
Done.
| |
78 | 78 |
79 // Called by sync to provide AttachmentService to be used to download | 79 // Called by sync to provide AttachmentService to be used to download |
80 // attachments. | 80 // attachments. |
81 // SetAttachmentService is called after GetAttachmentStore and right before | 81 // SetAttachmentService is called after GetAttachmentStore and right before |
82 // MergeDataAndStartSyncing and only if GetAttachmentStore has returned a | 82 // MergeDataAndStartSyncing and only if GetAttachmentStore has returned a |
83 // non-NULL store instance. Default implementation does nothing. | 83 // non-NULL store instance. Default implementation does nothing. |
84 // Datatype that uses attachments must take ownerhip of the provided | 84 // Datatype that uses attachments must take ownerhip of the provided |
85 // AttachmentService instance. | 85 // AttachmentService instance. |
86 virtual void SetAttachmentService( | 86 virtual void SetAttachmentService( |
87 scoped_ptr<AttachmentService> attachment_service); | 87 scoped_ptr<AttachmentService> attachment_service); |
88 | 88 |
89 protected: | 89 protected: |
90 ~SyncableService() override; | 90 ~SyncableService() override; |
91 }; | 91 }; |
92 | 92 |
93 } // namespace syncer | 93 } // namespace syncer |
94 | 94 |
95 #endif // SYNC_API_SYNCABLE_SERVICE_H_ | 95 #endif // SYNC_API_SYNCABLE_SERVICE_H_ |
OLD | NEW |