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

Unified Diff: sync/api/attachments/attachment_store.h

Issue 652723003: Implementation of OnDiskAttachmentStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: OVERRIDE => override Created 6 years, 2 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/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();

Powered by Google App Engine
This is Rietveld 408576698