| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ |
| 7 | 7 |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 void Read(const AttachmentIdList& ids, const ReadCallback& callback) override; | 40 void Read(const AttachmentIdList& ids, const ReadCallback& callback) override; |
| 41 void Write(const AttachmentList& attachments, | 41 void Write(const AttachmentList& attachments, |
| 42 const WriteCallback& callback) override; | 42 const WriteCallback& callback) override; |
| 43 void Drop(const AttachmentIdList& ids, const DropCallback& callback) override; | 43 void Drop(const AttachmentIdList& ids, const DropCallback& callback) override; |
| 44 | 44 |
| 45 // Opens leveldb database at |path|. It will create directory and database if | 45 // Opens leveldb database at |path|. It will create directory and database if |
| 46 // it doesn't exist. | 46 // it doesn't exist. |
| 47 Result OpenOrCreate(const base::FilePath& path); | 47 Result OpenOrCreate(const base::FilePath& path); |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 std::string CreateDataKeyFromAttachmentId(const AttachmentId& attachment_id); | 50 std::string MakeDataKeyFromAttachmentId(const AttachmentId& attachment_id); |
| 51 | 51 |
| 52 scoped_refptr<base::SequencedTaskRunner> callback_task_runner_; | 52 scoped_refptr<base::SequencedTaskRunner> callback_task_runner_; |
| 53 scoped_ptr<leveldb::DB> db_; | 53 scoped_ptr<leveldb::DB> db_; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace syncer | 56 } // namespace syncer |
| 57 | 57 |
| 58 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ | 58 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ON_DISK_ATTACHMENT_STORE_H_ |
| OLD | NEW |