OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DRIVER_MODEL_ASSOCIATOR_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_H_ |
6 #define COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_H_ | 6 #define COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "sync/api/sync_error.h" | 10 #include "sync/api/sync_error.h" |
11 #include "sync/internal_api/public/base/model_type.h" | 11 #include "sync/internal_api/public/base/model_type.h" |
12 | 12 |
13 namespace syncer { | 13 namespace syncer { |
14 class BaseNode; | 14 class BaseNode; |
15 class SyncMergeResult; | 15 class SyncMergeResult; |
16 } | 16 } |
17 | 17 |
18 namespace browser_sync { | 18 namespace sync_driver { |
19 | 19 |
20 // This represents the fundamental operations used for model association that | 20 // This represents the fundamental operations used for model association that |
21 // are common to all ModelAssociators and do not depend on types of the models | 21 // are common to all ModelAssociators and do not depend on types of the models |
22 // being associated. | 22 // being associated. |
23 class AssociatorInterface { | 23 class AssociatorInterface { |
24 public: | 24 public: |
25 virtual ~AssociatorInterface() {} | 25 virtual ~AssociatorInterface() {} |
26 | 26 |
27 // Iterates through both the sync and the chrome model looking for | 27 // Iterates through both the sync and the chrome model looking for |
28 // matched pairs of items. After successful completion, the models | 28 // matched pairs of items. After successful completion, the models |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 const IDType& node_id, | 83 const IDType& node_id, |
84 syncer::BaseNode* sync_node) = 0; | 84 syncer::BaseNode* sync_node) = 0; |
85 | 85 |
86 // Associates the given chrome node with the given sync id. | 86 // Associates the given chrome node with the given sync id. |
87 virtual void Associate(const Node* node, int64 sync_id) = 0; | 87 virtual void Associate(const Node* node, int64 sync_id) = 0; |
88 | 88 |
89 // Remove the association that corresponds to the given sync id. | 89 // Remove the association that corresponds to the given sync id. |
90 virtual void Disassociate(int64 sync_id) = 0; | 90 virtual void Disassociate(int64 sync_id) = 0; |
91 }; | 91 }; |
92 | 92 |
93 } // namespace browser_sync | 93 } // namespace sync_driver |
94 | 94 |
95 #endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_H_ | 95 #endif // COMPONENTS_SYNC_DRIVER_MODEL_ASSOCIATOR_H_ |
OLD | NEW |