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

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

Issue 2553143002: Create a strict order in ReadingListSpecifics (Closed)
Patch Set: comments 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..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
« 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