Chromium Code Reviews
DescriptionRefactor Reading List Model to use URL as key.
Here are the new principles for ReadingList model.
- Entries are uniquely defined by their URL. All methods to access or alter entries in the model are therefore using URL as key.
- All observers callbacks are therefore give the URL of the entry being modified, with the exception of WillAddEntry that takes the whole entry (as it is not yet in the model). A DidAddEntry observer is added if an observer want to do operation on this newly added entry.
- Model is now backed up by an unordered_map<GURL, ReadingListEntry>. This will make all operations accessing or updating entries O(1) instead of O(n).
- The read/unread status is now in the ReadingListEntry because
- most operation on entries are read status independant, so have the read status in the model requires to have two paths for each operations. Having the read status in the entry makes all operations easier
- ReadingListEntries in Chrome have always a defined read/unread status
- ReadingListEntry now reflect the sync counterpart ReadingListSpecifics.
- To display the entries, they must be ordered by UpdateTime. This CL adds a cache that allows to access the entries with GetReadEntryAt(size_t index) and GetUnreadEntryAt(size_t index). This cache will be moved in the ReadingListViewController later
- This CL adds dummy methods for downstream compatibility. These will be removed later.
BUG=664924
Committed: https://crrev.com/448b3411da25817b84202bff7c37bbc816c4b2b2
Cr-Commit-Position: refs/heads/master@{#435236}
Patch Set 1 #Patch Set 2 : format #
Total comments: 52
Patch Set 3 : feedback #
Total comments: 59
Patch Set 4 : keep unreadsize #Patch Set 5 : keep unread_size #
Total comments: 1
Patch Set 6 : typo #Patch Set 7 : jif feedback #
Total comments: 8
Patch Set 8 : feedback #Patch Set 9 : fix #Messages
Total messages: 29 (11 generated)
|