Chromium Code Reviews| 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 76648032c65f303c13ecf212443e2aa35ef15e1c..8a4fb3ddc50613169583fb329f1abe676f0d0ef6 100644 |
| --- a/components/reading_list/ios/reading_list_entry.h |
| +++ b/components/reading_list/ios/reading_list_entry.h |
| @@ -90,20 +90,24 @@ class ReadingListEntry { |
| static std::unique_ptr<ReadingListEntry> FromReadingListSpecifics( |
| const sync_pb::ReadingListSpecifics& pb_entry); |
| - // Merge the local data from |other| to this. |
| - // The local fields (distilled_state_, distilled_url_, backoff_, |
| - // failed_download_counter_) of |other| are moved to |this| and must not be |
| - // used after this call. |
| - void MergeLocalStateFrom(ReadingListEntry& other); |
| + // Merge |this| and |other| into this. |
| + // Local fields are kept from |this|. |
| + // If |other.UpdateTime()| >= |this.UpdateTime()|, all fields are copied from |
|
gambard
2016/12/07 10:28:49
"all fields are copied" is misleading: you do not
|
| + // |other|. |
| + // If one of the state is UNSEEN, the other state is kept. |
| + // |
| + // After calling |MergeLocalStateFrom|, the result must verify |
| + // ReadingListStore.CompareEntriesForSync(old_this.AsReadingListSpecifics(), |
| + // new_this.AsReadingListSpecifics()) |
| + // and |
| + // ReadingListStore.CompareEntriesForSync(other.AsReadingListSpecifics(), |
| + // new_this.AsReadingListSpecifics()). |
| + void MergeWithEntry(const ReadingListEntry& other); |
| ReadingListEntry& operator=(ReadingListEntry&& other); |
| bool operator==(const ReadingListEntry& other) const; |
| - // Returns whether |lhs| is more recent than |rhs|. |
| - static bool CompareEntryUpdateTime(const ReadingListEntry& lhs, |
| - const ReadingListEntry& rhs); |
| - |
| // Sets the title. |
| void SetTitle(const std::string& title); |
| // Sets the distilled URL and switch the state to PROCESSED and reset the time |