| 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 COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ | 5 #ifndef COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| 6 #define COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ | 6 #define COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 void AbortAssociation() override { | 107 void AbortAssociation() override { |
| 108 // No implementation needed, this associator runs on the main | 108 // No implementation needed, this associator runs on the main |
| 109 // thread. | 109 // thread. |
| 110 } | 110 } |
| 111 | 111 |
| 112 // See ModelAssociator interface. | 112 // See ModelAssociator interface. |
| 113 bool CryptoReadyIfNecessary() override; | 113 bool CryptoReadyIfNecessary() override; |
| 114 | 114 |
| 115 private: | 115 private: |
| 116 typedef std::map<int64_t, int64_t> BookmarkIdToSyncIdMap; | 116 using BookmarkIdToSyncIdMap = std::map<int64_t, int64_t>; |
| 117 typedef std::map<int64_t, const bookmarks::BookmarkNode*> | 117 using SyncIdToBookmarkNodeMap = |
| 118 SyncIdToBookmarkNodeMap; | 118 std::map<int64_t, const bookmarks::BookmarkNode*>; |
| 119 typedef std::set<int64_t> DirtyAssociationsSyncIds; | 119 using DirtyAssociationsSyncIds = std::set<int64_t>; |
| 120 typedef std::vector<const bookmarks::BookmarkNode*> BookmarkList; | 120 using BookmarkList = std::vector<const bookmarks::BookmarkNode*>; |
| 121 typedef std::stack<const bookmarks::BookmarkNode*> BookmarkStack; | 121 using BookmarkStack = std::stack<const bookmarks::BookmarkNode*>; |
| 122 | 122 |
| 123 // Add association between native node and sync node to the maps. | 123 // Add association between native node and sync node to the maps. |
| 124 void AddAssociation(const bookmarks::BookmarkNode* node, int64_t sync_id); | 124 void AddAssociation(const bookmarks::BookmarkNode* node, int64_t sync_id); |
| 125 | 125 |
| 126 // Posts a task to persist dirty associations. | 126 // Posts a task to persist dirty associations. |
| 127 void PostPersistAssociationsTask(); | 127 void PostPersistAssociationsTask(); |
| 128 // Persists all dirty associations. | 128 // Persists all dirty associations. |
| 129 void PersistAssociations(); | 129 void PersistAssociations(); |
| 130 | 130 |
| 131 // Result of the native model version check against the sync | 131 // Result of the native model version check against the sync |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 // guarantees no invocations can occur if |this| has been deleted. (This | 303 // guarantees no invocations can occur if |this| has been deleted. (This |
| 304 // allows this class to be non-refcounted). | 304 // allows this class to be non-refcounted). |
| 305 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; | 305 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; |
| 306 | 306 |
| 307 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 307 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 } // namespace sync_bookmarks | 310 } // namespace sync_bookmarks |
| 311 | 311 |
| 312 #endif // COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ | 312 #endif // COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |