| Index: ios/chrome/browser/reading_list/reading_list_model_storage.h
|
| diff --git a/ios/chrome/browser/reading_list/reading_list_model_storage.h b/ios/chrome/browser/reading_list/reading_list_model_storage.h
|
| index 1a009874128c7dc7df1d51fc332f528e0eecd672..72e5518ef4b420ccc0133035c92a8b4cbe65c321 100644
|
| --- a/ios/chrome/browser/reading_list/reading_list_model_storage.h
|
| +++ b/ios/chrome/browser/reading_list/reading_list_model_storage.h
|
| @@ -9,21 +9,37 @@
|
|
|
| #include "ios/chrome/browser/reading_list/reading_list_entry.h"
|
|
|
| -class ReadingListModel;
|
| +class ReadingListModelImpl;
|
| +
|
| +namespace syncer {
|
| +class ModelTypeService;
|
| +}
|
|
|
| // Interface for a persistence layer for reading list.
|
| // All interface methods have to be called on main thread.
|
| class ReadingListModelStorage {
|
| public:
|
| - virtual std::vector<ReadingListEntry> LoadPersistentReadList() = 0;
|
| - virtual std::vector<ReadingListEntry> LoadPersistentUnreadList() = 0;
|
| - virtual bool LoadPersistentHasUnseen() = 0;
|
| -
|
| - virtual void SavePersistentReadList(
|
| - const std::vector<ReadingListEntry>& read) = 0;
|
| - virtual void SavePersistentUnreadList(
|
| - const std::vector<ReadingListEntry>& unread) = 0;
|
| - virtual void SavePersistentHasUnseen(bool has_unseen) = 0;
|
| + // Sets the model the Storage is backing.
|
| + virtual void SetReadingListModel(ReadingListModelImpl* model) = 0;
|
| +
|
| + virtual syncer::ModelTypeService* GetModelTypeService() = 0;
|
| +
|
| + // Starts a transation. All Save/Remove entry will be delayed until the
|
| + // transaction is commited.
|
| + // Multiple transaction can be started at the same time. Commit will happen
|
| + // when the last transaction is commited.
|
| + // Calls to BeginTransaction and CommitTransaction must be balanced.
|
| + virtual void BeginTransaction() = 0;
|
| + virtual void CommitTransaction() = 0;
|
| +
|
| + // Saves or updates an entry. If the entry is not yet in the database, it is
|
| + // created.
|
| + virtual void SaveEntry(const ReadingListEntry& entry,
|
| + bool read,
|
| + bool from_sync) = 0;
|
| +
|
| + // Removed an entry from the storage.
|
| + virtual void RemoveEntry(const ReadingListEntry& entry, bool from_sync) = 0;
|
| };
|
|
|
| #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_MODEL_STORAGE_H_
|
|
|