OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 bool AssociateTaggedPermanentNode( | 134 bool AssociateTaggedPermanentNode( |
135 const BookmarkNode* permanent_node, | 135 const BookmarkNode* permanent_node, |
136 const std::string& tag) WARN_UNUSED_RESULT; | 136 const std::string& tag) WARN_UNUSED_RESULT; |
137 | 137 |
138 // Compare the properties of a pair of nodes from either domain. | 138 // Compare the properties of a pair of nodes from either domain. |
139 bool NodesMatch(const BookmarkNode* bookmark, | 139 bool NodesMatch(const BookmarkNode* bookmark, |
140 const syncer::BaseNode* sync_node) const; | 140 const syncer::BaseNode* sync_node) const; |
141 | 141 |
142 // Check whether bookmark model and sync model are synced by comparing | 142 // Check whether bookmark model and sync model are synced by comparing |
143 // their transaction versions. | 143 // their transaction versions. |
144 void CheckModelSyncState(syncer::SyncMergeResult* local_merge_result, | 144 // Returns a PERSISTENCE_ERROR if a transaction mismatch was detected where |
145 syncer::SyncMergeResult* syncer_merge_result) const; | 145 // the native model has a newer transaction verison. |
| 146 syncer::SyncError CheckModelSyncState( |
| 147 syncer::SyncMergeResult* local_merge_result, |
| 148 syncer::SyncMergeResult* syncer_merge_result) const; |
146 | 149 |
147 BookmarkModel* bookmark_model_; | 150 BookmarkModel* bookmark_model_; |
148 Profile* profile_; | 151 Profile* profile_; |
149 syncer::UserShare* user_share_; | 152 syncer::UserShare* user_share_; |
150 DataTypeErrorHandler* unrecoverable_error_handler_; | 153 DataTypeErrorHandler* unrecoverable_error_handler_; |
151 const bool expect_mobile_bookmarks_folder_; | 154 const bool expect_mobile_bookmarks_folder_; |
152 BookmarkIdToSyncIdMap id_map_; | 155 BookmarkIdToSyncIdMap id_map_; |
153 SyncIdToBookmarkNodeMap id_map_inverse_; | 156 SyncIdToBookmarkNodeMap id_map_inverse_; |
154 // Stores sync ids for dirty associations. | 157 // Stores sync ids for dirty associations. |
155 DirtyAssociationsSyncIds dirty_associations_sync_ids_; | 158 DirtyAssociationsSyncIds dirty_associations_sync_ids_; |
156 | 159 |
157 // Used to post PersistAssociation tasks to the current message loop and | 160 // Used to post PersistAssociation tasks to the current message loop and |
158 // guarantees no invocations can occur if |this| has been deleted. (This | 161 // guarantees no invocations can occur if |this| has been deleted. (This |
159 // allows this class to be non-refcounted). | 162 // allows this class to be non-refcounted). |
160 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; | 163 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; |
161 | 164 |
162 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 165 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
163 }; | 166 }; |
164 | 167 |
165 } // namespace browser_sync | 168 } // namespace browser_sync |
166 | 169 |
167 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 170 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
OLD | NEW |