| 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 COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ |
| 6 #define COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ | 6 #define COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // Process a list of new SyncChanges and update the local data as necessary. | 60 // Process a list of new SyncChanges and update the local data as necessary. |
| 61 // Returns: A default SyncError (IsSet() == false) if no errors were | 61 // Returns: A default SyncError (IsSet() == false) if no errors were |
| 62 // encountered, and a filled SyncError (IsSet() == true) | 62 // encountered, and a filled SyncError (IsSet() == true) |
| 63 // otherwise. | 63 // otherwise. |
| 64 SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, | 64 SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, |
| 65 const SyncChangeList& change_list) override = 0; | 65 const SyncChangeList& change_list) override = 0; |
| 66 | 66 |
| 67 // Returns AttachmentStore for use by sync when uploading or downloading | 67 // Returns AttachmentStore for use by sync when uploading or downloading |
| 68 // attachments. | 68 // attachments. |
| 69 // GetAttachmentStoreForSync is called right before MergeDataAndStartSyncing. | 69 // GetAttachmentStoreForSync is called right before MergeDataAndStartSyncing. |
| 70 // If at that time GetAttachmentStoreForSync returns NULL then datatype is | 70 // If at that time GetAttachmentStoreForSync returns null then datatype is |
| 71 // considered not using attachments and all attempts to upload/download | 71 // considered not using attachments and all attempts to upload/download |
| 72 // attachments will fail. Default implementation returns NULL. Datatype that | 72 // attachments will fail. Default implementation returns null. Datatype that |
| 73 // uses sync attachments should create attachment store, implement | 73 // uses sync attachments should create attachment store, implement |
| 74 // GetAttachmentStoreForSync to return result of | 74 // GetAttachmentStoreForSync to return result of |
| 75 // AttachmentStore::CreateAttachmentStoreForSync() from attachment store | 75 // AttachmentStore::CreateAttachmentStoreForSync() from attachment store |
| 76 // object. | 76 // object. |
| 77 virtual std::unique_ptr<AttachmentStoreForSync> GetAttachmentStoreForSync(); | 77 virtual std::unique_ptr<AttachmentStoreForSync> GetAttachmentStoreForSync(); |
| 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 std::unique_ptr<AttachmentService> attachment_service); | 87 std::unique_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 // COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ | 95 #endif // COMPONENTS_SYNC_MODEL_SYNCABLE_SERVICE_H_ |
| OLD | NEW |