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

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

Issue 2553143002: Create a strict order in ReadingListSpecifics (Closed)
Patch Set: order by field 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
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..3c75a80aa4f4d73db1b08045049a5091ac8796ed 100644
--- a/components/reading_list/ios/reading_list_entry.h
+++ b/components/reading_list/ios/reading_list_entry.h
@@ -90,20 +90,23 @@ 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|.
+ // Each field is merged individually keeping the highest value as defined by
+ // the |ReadingListStore.CompareEntriesForSync| function.
+ //
+ // 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
« no previous file with comments | « no previous file | components/reading_list/ios/reading_list_entry.cc » ('j') | components/reading_list/ios/reading_list_entry.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698