Chromium Code Reviews| Index: sync/api/attachments/attachment_store.h |
| diff --git a/sync/api/attachments/attachment_store.h b/sync/api/attachments/attachment_store.h |
| index d487f8cd1775673a6cc3cee53b788e9f730f6c35..7a69b13b7f2a75a38e0d57f4c731bff41ea0e967 100644 |
| --- a/sync/api/attachments/attachment_store.h |
| +++ b/sync/api/attachments/attachment_store.h |
| @@ -25,10 +25,8 @@ class AttachmentId; |
| // |
| // Destroying this object does not necessarily cancel outstanding async |
| // operations. If you need cancel like semantics, use WeakPtr in the callbacks. |
| -class SYNC_EXPORT AttachmentStore : public base::RefCounted<AttachmentStore> { |
| +class SYNC_EXPORT AttachmentStoreBase { |
|
maniscalco
2014/09/29 20:57:52
Can/should ASB be made SYNC_PRIVATE?
pavely
2014/09/29 23:27:08
It is base class for AttachmentStore which should
maniscalco
2014/09/30 00:26:13
You're right, I agree.
|
| public: |
| - AttachmentStore(); |
| - |
| // TODO(maniscalco): Consider udpating Read and Write methods to support |
| // resumable transfers (bug 353292). |
| @@ -43,6 +41,9 @@ class SYNC_EXPORT AttachmentStore : public base::RefCounted<AttachmentStore> { |
| typedef base::Callback<void(const Result&)> WriteCallback; |
| typedef base::Callback<void(const Result&)> DropCallback; |
| + AttachmentStoreBase(); |
| + virtual ~AttachmentStoreBase(); |
| + |
| // Asynchronously reads the attachments identified by |ids|. |
| // |
| // |callback| will be invoked when finished. AttachmentStore will attempt to |
| @@ -81,6 +82,18 @@ class SYNC_EXPORT AttachmentStore : public base::RefCounted<AttachmentStore> { |
| // successfully. |
| virtual void Drop(const AttachmentIdList& ids, |
| const DropCallback& callback) = 0; |
| +}; |
| + |
| +// AttachmentStore is an interface exposed to device type and AttachmentService |
|
maniscalco
2014/09/29 20:57:52
s/device/data/
pavely
2014/09/29 23:27:07
Done.
|
| +// code. Also contains factory methods for default implementations. |
| +class SYNC_EXPORT AttachmentStore : public AttachmentStoreBase, |
| + public base::RefCounted<AttachmentStore> { |
|
maniscalco
2014/09/29 20:57:52
I would be inclined to use RefCountedThreadSafe (h
pavely
2014/09/29 23:27:07
Done.
|
| + public: |
| + AttachmentStore(); |
| + |
| + // Creates an AttachmentStoreProxy backed by in-memory implementation of |
| + // attachment store. For now frontend lives on the same thread as backend. |
| + static scoped_refptr<AttachmentStore> CreateInMemoryStore(); |
| protected: |
| friend class base::RefCounted<AttachmentStore>; |