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() const; | 144 // Returns a PERSISTENCE_ERROR if a transaction mismatch was detected where |
| 145 // the native model has a newer transaction verison. |
| 146 syncer::SyncError CheckModelSyncState() const; |
145 | 147 |
146 BookmarkModel* bookmark_model_; | 148 BookmarkModel* bookmark_model_; |
147 Profile* profile_; | 149 Profile* profile_; |
148 syncer::UserShare* user_share_; | 150 syncer::UserShare* user_share_; |
149 DataTypeErrorHandler* unrecoverable_error_handler_; | 151 DataTypeErrorHandler* unrecoverable_error_handler_; |
150 const bool expect_mobile_bookmarks_folder_; | 152 const bool expect_mobile_bookmarks_folder_; |
151 BookmarkIdToSyncIdMap id_map_; | 153 BookmarkIdToSyncIdMap id_map_; |
152 SyncIdToBookmarkNodeMap id_map_inverse_; | 154 SyncIdToBookmarkNodeMap id_map_inverse_; |
153 // Stores sync ids for dirty associations. | 155 // Stores sync ids for dirty associations. |
154 DirtyAssociationsSyncIds dirty_associations_sync_ids_; | 156 DirtyAssociationsSyncIds dirty_associations_sync_ids_; |
155 | 157 |
156 // Used to post PersistAssociation tasks to the current message loop and | 158 // Used to post PersistAssociation tasks to the current message loop and |
157 // guarantees no invocations can occur if |this| has been deleted. (This | 159 // guarantees no invocations can occur if |this| has been deleted. (This |
158 // allows this class to be non-refcounted). | 160 // allows this class to be non-refcounted). |
159 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; | 161 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; |
160 | 162 |
161 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 163 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
162 }; | 164 }; |
163 | 165 |
164 } // namespace browser_sync | 166 } // namespace browser_sync |
165 | 167 |
166 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ | 168 #endif // CHROME_BROWSER_SYNC_GLUE_BOOKMARK_MODEL_ASSOCIATOR_H_ |
OLD | NEW |