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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 syncer::SyncError ApplySyncChanges( | 66 syncer::SyncError ApplySyncChanges( |
67 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, | 67 std::unique_ptr<syncer::MetadataChangeList> metadata_change_list, |
68 syncer::EntityChangeList entity_changes) override; | 68 syncer::EntityChangeList entity_changes) override; |
69 | 69 |
70 // Returns whether entries respect a strict order for sync and if |rhs| can be | 70 // Returns whether entries respect a strict order for sync and if |rhs| can be |
71 // submitted to sync after |lhs| has been received. | 71 // submitted to sync after |lhs| has been received. |
72 // The order should ensure that there is no sync loop in sync and should be | 72 // The order should ensure that there is no sync loop in sync and should be |
73 // submitted to sync in strictly increasing order. | 73 // submitted to sync in strictly increasing order. |
74 // Entries are in increasing order if all the fields respect increasing order. | 74 // Entries are in increasing order if all the fields respect increasing order. |
75 // - URL must be the same. | 75 // - URL must be the same. |
76 // - title must verify rhs.title.compare(lhs.title) >= 0 | 76 // - update_title_time_us: |
| 77 // rhs.update_title_time_us >= lhs.update_title_time_us |
| 78 // - title: |
| 79 // if rhs.update_title_time_us > lhs.update_title_time_us |
| 80 // title can be anything |
| 81 // if rhs.update_title_time_us == lhs.update_title_time_us |
| 82 // title must verify rhs.title.compare(lhs.title) >= 0 |
77 // - creation_time_us: | 83 // - creation_time_us: |
78 // rhs.creation_time_us >= lhs.creation_time_us | 84 // rhs.creation_time_us >= lhs.creation_time_us |
79 // - rhs.first_read_time_us: | 85 // - rhs.first_read_time_us: |
80 // if rhs.creation_time_us > lhs.creation_time_us, | 86 // if rhs.creation_time_us > lhs.creation_time_us, |
81 // rhs.first_read_time_us can be anything. | 87 // rhs.first_read_time_us can be anything. |
82 // if rhs.creation_time_us == lhs.creation_time_us | 88 // if rhs.creation_time_us == lhs.creation_time_us |
83 // and rhs.first_read_time_us == 0 | 89 // and rhs.first_read_time_us == 0 |
84 // rhs.first_read_time_us can be anything. | 90 // rhs.first_read_time_us can be anything. |
85 // if rhs.creation_time_us == lhs.creation_time_us, | 91 // if rhs.creation_time_us == lhs.creation_time_us, |
86 // rhs.first_read_time_us <= lhs.first_read_time_us | 92 // rhs.first_read_time_us <= lhs.first_read_time_us |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 std::unique_ptr<syncer::ModelTypeStore> store_; | 156 std::unique_ptr<syncer::ModelTypeStore> store_; |
151 ReadingListModel* model_; | 157 ReadingListModel* model_; |
152 ReadingListStoreDelegate* delegate_; | 158 ReadingListStoreDelegate* delegate_; |
153 StoreFactoryFunction create_store_callback_; | 159 StoreFactoryFunction create_store_callback_; |
154 | 160 |
155 int pending_transaction_count_; | 161 int pending_transaction_count_; |
156 std::unique_ptr<syncer::ModelTypeStore::WriteBatch> batch_; | 162 std::unique_ptr<syncer::ModelTypeStore::WriteBatch> batch_; |
157 }; | 163 }; |
158 | 164 |
159 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_H_ | 165 #endif // COMPONENTS_READING_LIST_IOS_READING_LIST_STORE_H_ |
OLD | NEW |