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

Unified Diff: sync/api/syncable_service.h

Issue 548373003: Move AttachmentStore ownership to datatype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't create AttachmentService in GenericChangeProcessor if AttachmentStore is NULL Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: sync/api/syncable_service.h
diff --git a/sync/api/syncable_service.h b/sync/api/syncable_service.h
index 81b6018b32afb23a18d939fd8078a528dcf76def..9b68d29eadff0a3c47d7d7ea3dce7714d6af0502 100644
--- a/sync/api/syncable_service.h
+++ b/sync/api/syncable_service.h
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "sync/api/attachments/attachment_store.h"
#include "sync/api/sync_change_processor.h"
#include "sync/api/sync_data.h"
#include "sync/api/sync_error.h"
@@ -65,6 +66,16 @@ class SYNC_EXPORT SyncableService
const tracked_objects::Location& from_here,
const SyncChangeList& change_list) OVERRIDE = 0;
+ // Returns AttachmentStore used by datatype. Attachment store is used by sync
+ // when uploading or downloading attachments.
+ // GetAttachmentStore is called right before MergeDataAndStartSyncing. If at
+ // that time GetAttachmentStore returns NULL then datatype is considered not
+ // using attachments and all attempts to upload/download attachments will
+ // fail. Default implementation returns NULL. Datatype that uses sync
+ // attachemnts should create attachment store and implement GetAttachmentStore
+ // to return pointer to it.
+ virtual scoped_refptr<AttachmentStore> GetAttachmentStore();
+
protected:
virtual ~SyncableService();
};

Powered by Google App Engine
This is Rietveld 408576698