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

Unified Diff: components/reading_list/ios/reading_list_entry.h

Issue 2525663002: Refactor Reading List Model to use URL as key. (Closed)
Patch Set: fix Created 4 years 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
« no previous file with comments | « no previous file | components/reading_list/ios/reading_list_entry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/reading_list/ios/reading_list_entry.h
diff --git a/components/reading_list/ios/reading_list_entry.h b/components/reading_list/ios/reading_list_entry.h
index 0f87c1487a17582570dda9aed55d4fdec676cc05..caa505cb764922e0b991e21c8f22561b7f1f8704 100644
--- a/components/reading_list/ios/reading_list_entry.h
+++ b/components/reading_list/ios/reading_list_entry.h
@@ -22,7 +22,6 @@ class ReadingListSpecifics;
}
class ReadingListEntry;
-using ReadingListEntries = std::vector<ReadingListEntry>;
// An entry in the reading list. The URL is a unique identifier for an entry, as
// such it should not be empty and is the only thing considered when comparing
@@ -60,6 +59,8 @@ class ReadingListEntry {
// automatically increased when the state is set to WILL_RETRY or ERROR from a
// non-error state.
int FailedDownloadCounter() const;
+ // The read status of the entry.
+ bool IsRead() const;
// The last update time of the entry. This value may be used to sort the
// entries. The value is in microseconds since Jan 1st 1970.
@@ -74,12 +75,10 @@ class ReadingListEntry {
// Returns a protobuf encoding the content of this ReadingListEntry for local
// storage.
- std::unique_ptr<reading_list::ReadingListLocal> AsReadingListLocal(
- bool read) const;
+ std::unique_ptr<reading_list::ReadingListLocal> AsReadingListLocal() const;
// Returns a protobuf encoding the content of this ReadingListEntry for sync.
- std::unique_ptr<sync_pb::ReadingListSpecifics> AsReadingListSpecifics(
- bool read) const;
+ std::unique_ptr<sync_pb::ReadingListSpecifics> AsReadingListSpecifics() const;
// Created a ReadingListEntry from the protobuf format.
static std::unique_ptr<ReadingListEntry> FromReadingListLocal(
@@ -110,10 +109,13 @@ class ReadingListEntry {
void SetDistilledPath(const base::FilePath& path);
// Sets the state to one of PROCESSING, WILL_RETRY or ERROR.
void SetDistilledState(DistillationState distilled_state);
+ // Sets the read stat of the entry. Will set the UpdateTime of the entry.
+ void SetRead(bool read);
private:
ReadingListEntry(const GURL& url,
const std::string& title,
+ bool read,
int64_t creation_time,
int64_t update_time,
ReadingListEntry::DistillationState distilled_state,
@@ -122,6 +124,7 @@ class ReadingListEntry {
std::unique_ptr<net::BackoffEntry> backoff);
GURL url_;
std::string title_;
+ bool read_;
base::FilePath distilled_path_;
DistillationState distilled_state_;
« no previous file with comments | « no previous file | components/reading_list/ios/reading_list_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698