| 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 26 matching lines...) Expand all Loading... |
| 37 class BaseNode; | 37 class BaseNode; |
| 38 class BaseTransaction; | 38 class BaseTransaction; |
| 39 struct UserShare; | 39 struct UserShare; |
| 40 class WriteTransaction; | 40 class WriteTransaction; |
| 41 } | 41 } |
| 42 | 42 |
| 43 namespace sync_driver { | 43 namespace sync_driver { |
| 44 class SyncClient; | 44 class SyncClient; |
| 45 } | 45 } |
| 46 | 46 |
| 47 namespace browser_sync { | 47 namespace sync_bookmarks { |
| 48 | 48 |
| 49 // Contains all model association related logic: | 49 // Contains all model association related logic: |
| 50 // * Algorithm to associate bookmark model and sync model. | 50 // * Algorithm to associate bookmark model and sync model. |
| 51 // * Methods to get a bookmark node for a given sync node and vice versa. | 51 // * Methods to get a bookmark node for a given sync node and vice versa. |
| 52 // * Persisting model associations and loading them back. | 52 // * Persisting model associations and loading them back. |
| 53 class BookmarkModelAssociator | 53 class BookmarkModelAssociator |
| 54 : public sync_driver:: | 54 : public sync_driver:: |
| 55 PerDataTypeAssociatorInterface<bookmarks::BookmarkNode, int64_t> { | 55 PerDataTypeAssociatorInterface<bookmarks::BookmarkNode, int64_t> { |
| 56 public: | 56 public: |
| 57 static syncer::ModelType model_type() { return syncer::BOOKMARKS; } | 57 static syncer::ModelType model_type() { return syncer::BOOKMARKS; } |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 DirtyAssociationsSyncIds dirty_associations_sync_ids_; | 303 DirtyAssociationsSyncIds dirty_associations_sync_ids_; |
| 304 | 304 |
| 305 // Used to post PersistAssociation tasks to the current message loop and | 305 // Used to post PersistAssociation tasks to the current message loop and |
| 306 // guarantees no invocations can occur if |this| has been deleted. (This | 306 // guarantees no invocations can occur if |this| has been deleted. (This |
| 307 // allows this class to be non-refcounted). | 307 // allows this class to be non-refcounted). |
| 308 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; | 308 base::WeakPtrFactory<BookmarkModelAssociator> weak_factory_; |
| 309 | 309 |
| 310 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); | 310 DISALLOW_COPY_AND_ASSIGN(BookmarkModelAssociator); |
| 311 }; | 311 }; |
| 312 | 312 |
| 313 } // namespace browser_sync | 313 } // namespace sync_bookmarks |
| 314 | 314 |
| 315 #endif // COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ | 315 #endif // COMPONENTS_SYNC_BOOKMARKS_BOOKMARK_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |