OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_READING_LIST_IOS_READING_LIST_ENTRY_H_ | 5 #ifndef COMPONENTS_READING_LIST_IOS_READING_LIST_ENTRY_H_ |
6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_ENTRY_H_ | 6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_ENTRY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 int FailedDownloadCounter() const; | 61 int FailedDownloadCounter() const; |
62 // The read status of the entry. | 62 // The read status of the entry. |
63 bool IsRead() const; | 63 bool IsRead() const; |
64 // Returns if an entry has ever been seen. | 64 // Returns if an entry has ever been seen. |
65 bool HasBeenSeen() const; | 65 bool HasBeenSeen() const; |
66 | 66 |
67 // The last update time of the entry. This value may be used to sort the | 67 // The last update time of the entry. This value may be used to sort the |
68 // entries. The value is in microseconds since Jan 1st 1970. | 68 // entries. The value is in microseconds since Jan 1st 1970. |
69 int64_t UpdateTime() const; | 69 int64_t UpdateTime() const; |
70 | 70 |
| 71 // The last update time of the title of the entry. The value is in |
| 72 // microseconds since Jan 1st 1970. |
| 73 int64_t UpdateTitleTime() const; |
| 74 |
71 // The creation update time of the entry. The value is in microseconds since | 75 // The creation update time of the entry. The value is in microseconds since |
72 // Jan 1st 1970. | 76 // Jan 1st 1970. |
73 int64_t CreationTime() const; | 77 int64_t CreationTime() const; |
74 | 78 |
75 // The time when the entry was read for the first time. The value is in | 79 // The time when the entry was read for the first time. The value is in |
76 // microseconds since Jan 1st 1970. | 80 // microseconds since Jan 1st 1970. |
77 int64_t FirstReadTime() const; | 81 int64_t FirstReadTime() const; |
78 | 82 |
79 // Set the update time to now. | 83 // Set the update time to now. |
80 void MarkEntryUpdated(); | 84 void MarkEntryUpdated(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void SetRead(bool read); | 126 void SetRead(bool read); |
123 | 127 |
124 private: | 128 private: |
125 enum State { UNSEEN, UNREAD, READ }; | 129 enum State { UNSEEN, UNREAD, READ }; |
126 ReadingListEntry(const GURL& url, | 130 ReadingListEntry(const GURL& url, |
127 const std::string& title, | 131 const std::string& title, |
128 State state, | 132 State state, |
129 int64_t creation_time, | 133 int64_t creation_time, |
130 int64_t first_read_time, | 134 int64_t first_read_time, |
131 int64_t update_time, | 135 int64_t update_time, |
| 136 int64_t update_title_time, |
132 ReadingListEntry::DistillationState distilled_state, | 137 ReadingListEntry::DistillationState distilled_state, |
133 const base::FilePath& distilled_path, | 138 const base::FilePath& distilled_path, |
134 int failed_download_counter, | 139 int failed_download_counter, |
135 std::unique_ptr<net::BackoffEntry> backoff); | 140 std::unique_ptr<net::BackoffEntry> backoff); |
136 GURL url_; | 141 GURL url_; |
137 std::string title_; | 142 std::string title_; |
138 State state_; | 143 State state_; |
139 base::FilePath distilled_path_; | 144 base::FilePath distilled_path_; |
140 DistillationState distilled_state_; | 145 DistillationState distilled_state_; |
141 | 146 |
142 std::unique_ptr<net::BackoffEntry> backoff_; | 147 std::unique_ptr<net::BackoffEntry> backoff_; |
143 int failed_download_counter_; | 148 int failed_download_counter_; |
144 | 149 |
145 // These value are in microseconds since Jan 1st 1970. They are used for | 150 // These value are in microseconds since Jan 1st 1970. They are used for |
146 // sorting the entries from the database. They are kept in int64_t to avoid | 151 // sorting the entries from the database. They are kept in int64_t to avoid |
147 // conversion on each save/read event. | 152 // conversion on each save/read event. |
148 int64_t creation_time_us_; | 153 int64_t creation_time_us_; |
149 int64_t first_read_time_us_; | 154 int64_t first_read_time_us_; |
150 int64_t update_time_us_; | 155 int64_t update_time_us_; |
| 156 int64_t update_title_time_us_; |
151 | 157 |
152 DISALLOW_COPY_AND_ASSIGN(ReadingListEntry); | 158 DISALLOW_COPY_AND_ASSIGN(ReadingListEntry); |
153 }; | 159 }; |
154 | 160 |
155 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_ENTRY_H_ | 161 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_ENTRY_H_ |
OLD | NEW |