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_STORE_H_ | 5 #ifndef COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_H_ |
6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_H_ | 6 #define COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_H_ |
7 | 7 |
8 #include "base/threading/non_thread_safe.h" | 8 #include "base/threading/non_thread_safe.h" |
9 #include "components/reading_list/ios/reading_list_model_storage.h" | 9 #include "components/reading_list/ios/reading_list_model_storage.h" |
10 #include "components/reading_list/ios/reading_list_store_delegate.h" | 10 #include "components/reading_list/ios/reading_list_store_delegate.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 syncer::EntityChangeList entity_changes) override; | 73 syncer::EntityChangeList entity_changes) override; |
74 | 74 |
75 // Returns whether entries respect a strict order for sync and if |rhs| can be | 75 // Returns whether entries respect a strict order for sync and if |rhs| can be |
76 // submitted to sync after |lhs| has been received. | 76 // submitted to sync after |lhs| has been received. |
77 // The order should ensure that there is no sync loop in sync and should be | 77 // The order should ensure that there is no sync loop in sync and should be |
78 // submitted to sync in strictly increasing order. | 78 // submitted to sync in strictly increasing order. |
79 // Entries are in increasing order if all the fields respect increasing order. | 79 // Entries are in increasing order if all the fields respect increasing order. |
80 // - URL must be the same. | 80 // - URL must be the same. |
81 // - title must verify rhs.title.compare(lhs.title) >= 0 | 81 // - title must verify rhs.title.compare(lhs.title) >= 0 |
82 // - rhs.creation_time_us >= lhs.creation_time_us | 82 // - rhs.creation_time_us >= lhs.creation_time_us |
83 // - if rhs.creation_time_us > lhs.creation_time_us, rhs.first_read_time_us | |
84 // can be anything. | |
85 // - if rhs.creation_time_us == lhs.creation_time_us, t | |
gambard
2016/12/09 08:06:55
remove "t"
| |
86 // rhs.first_read_time_us <= lhs.first_read_time_us | |
gambard
2016/12/09 08:06:55
What happens if lhs.first_read_time_us == 0?
| |
83 // - rhs.update_time_us >= lhs.update_time_us | 87 // - rhs.update_time_us >= lhs.update_time_us |
84 // - if rhs.update_time_us > lhs.update_time_us, rhs.state can be anything. | 88 // - if rhs.update_time_us > lhs.update_time_us, rhs.state can be anything. |
85 // - if rhs.update_time_us == lhs.update_time_us, rhs.state >= lhs.state in | 89 // - if rhs.update_time_us == lhs.update_time_us, rhs.state >= lhs.state in |
86 // the order UNSEEN, UNREAD, READ. | 90 // the order UNSEEN, UNREAD, READ. |
87 static bool CompareEntriesForSync(const sync_pb::ReadingListSpecifics& lhs, | 91 static bool CompareEntriesForSync(const sync_pb::ReadingListSpecifics& lhs, |
88 const sync_pb::ReadingListSpecifics& rhs); | 92 const sync_pb::ReadingListSpecifics& rhs); |
89 | 93 |
90 // Asynchronously retrieve the corresponding sync data for |storage_keys|. | 94 // Asynchronously retrieve the corresponding sync data for |storage_keys|. |
91 void GetData(StorageKeyList storage_keys, DataCallback callback) override; | 95 void GetData(StorageKeyList storage_keys, DataCallback callback) override; |
92 | 96 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 std::unique_ptr<syncer::ModelTypeStore> store_; | 147 std::unique_ptr<syncer::ModelTypeStore> store_; |
144 ReadingListModel* model_; | 148 ReadingListModel* model_; |
145 ReadingListStoreDelegate* delegate_; | 149 ReadingListStoreDelegate* delegate_; |
146 StoreFactoryFunction create_store_callback_; | 150 StoreFactoryFunction create_store_callback_; |
147 | 151 |
148 int pending_transaction_count_; | 152 int pending_transaction_count_; |
149 std::unique_ptr<syncer::ModelTypeStore::WriteBatch> batch_; | 153 std::unique_ptr<syncer::ModelTypeStore::WriteBatch> batch_; |
150 }; | 154 }; |
151 | 155 |
152 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_H_ | 156 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_H_ |
OLD | NEW |