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 45ccaf9c8efa355eaa53862eaf89463fc86c97eb..e4da08fa5964d2a38bb44111ef5a311e39f5f6b4 100644 |
| --- a/sync/api/attachments/attachment_store.h |
| +++ b/sync/api/attachments/attachment_store.h |
| @@ -13,6 +13,7 @@ |
| #include "sync/base/sync_export.h" |
| namespace base { |
| +class FilePath; |
| class RefCountedMemory; |
| } // namespace base |
| @@ -35,6 +36,7 @@ class SYNC_EXPORT AttachmentStoreBase { |
| UNSPECIFIED_ERROR, // An unspecified error occurred for one or more items. |
| }; |
| + typedef base::Callback<void(const Result&)> LoadCallback; |
| typedef base::Callback<void(const Result&, |
| scoped_ptr<AttachmentMap>, |
| scoped_ptr<AttachmentIdList>)> ReadCallback; |
| @@ -44,6 +46,13 @@ class SYNC_EXPORT AttachmentStoreBase { |
| AttachmentStoreBase(); |
| virtual ~AttachmentStoreBase(); |
| + // Asynchronously loads attachment store. |
| + // |
| + // |callback| will be invoked once AttachmentStore is loaded. If |callback|'s |
| + // result is SUCCESS store is ready for operations. Otherwise result will be |
| + // UNSPECIFIED_ERROR. |
| + virtual void Load(const LoadCallback& callback) = 0; |
|
maniscalco
2014/10/14 21:03:18
What's the workflow here? Call a Create method, t
pavely
2014/10/16 22:13:29
Removed method altogether.
|
| + |
| // Asynchronously reads the attachments identified by |ids|. |
| // |
| // |callback| will be invoked when finished. AttachmentStore will attempt to |
| @@ -96,6 +105,9 @@ class SYNC_EXPORT AttachmentStore |
| // attachment store. For now frontend lives on the same thread as backend. |
| static scoped_refptr<AttachmentStore> CreateInMemoryStore(); |
| + static scoped_refptr<AttachmentStore> CreateOnDiskStore( |
|
maniscalco
2014/10/14 21:03:18
Can you please document this method?
pavely
2014/10/16 22:13:29
Done.
|
| + const base::FilePath& path); |
| + |
| protected: |
| friend class base::RefCountedThreadSafe<AttachmentStore>; |
| virtual ~AttachmentStore(); |