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

Unified Diff: sync/internal_api/public/attachments/on_disk_attachment_store.h

Issue 690723004: Add per attachment metadata records. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes after feedback. 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/internal_api/public/attachments/on_disk_attachment_store.h
diff --git a/sync/internal_api/public/attachments/on_disk_attachment_store.h b/sync/internal_api/public/attachments/on_disk_attachment_store.h
index 51e5dabea9ce3a5e768f7073210e180622e059f2..e8d60962bd65b8373e0a0ec0d9cd59109eebc578 100644
--- a/sync/internal_api/public/attachments/on_disk_attachment_store.h
+++ b/sync/internal_api/public/attachments/on_disk_attachment_store.h
@@ -47,7 +47,18 @@ class SYNC_EXPORT OnDiskAttachmentStore : public AttachmentStoreBase,
Result OpenOrCreate(const base::FilePath& path);
private:
- std::string MakeDataKeyFromAttachmentId(const AttachmentId& attachment_id);
+ friend class OnDiskAttachmentStoreSpecificTest;
+
+ // Reads single attachment from store. Returns nullptr in case of errors.
+ scoped_ptr<Attachment> ReadSingleAttachment(
+ const AttachmentId& attachment_id);
+ // Writes single attachment to store. Returns false in case of errors.
+ bool WriteSingleAttachment(const Attachment& attachment);
+
+ static std::string MakeDataKeyFromAttachmentId(
+ const AttachmentId& attachment_id);
+ static std::string MakeMetadataKeyFromAttachmentId(
+ const AttachmentId& attachment_id);
scoped_refptr<base::SequencedTaskRunner> callback_task_runner_;
scoped_ptr<leveldb::DB> db_;

Powered by Google App Engine
This is Rietveld 408576698