OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // I/O to when it no longer holds any lock). | 124 // I/O to when it no longer holds any lock). |
125 virtual void OnChangesComplete(ModelType model_type) = 0; | 125 virtual void OnChangesComplete(ModelType model_type) = 0; |
126 | 126 |
127 protected: | 127 protected: |
128 virtual ~ChangeDelegate(); | 128 virtual ~ChangeDelegate(); |
129 }; | 129 }; |
130 | 130 |
131 // Like ChangeDelegate, except called only on the sync thread and | 131 // Like ChangeDelegate, except called only on the sync thread and |
132 // not while a transaction is held. For objects that want to know | 132 // not while a transaction is held. For objects that want to know |
133 // when changes happen, but don't need to process them. | 133 // when changes happen, but don't need to process them. |
134 class ChangeObserver { | 134 class SYNC_EXPORT_PRIVATE ChangeObserver { |
135 public: | 135 public: |
136 // Ids referred to in |changes| may or may not be in the write | 136 // Ids referred to in |changes| may or may not be in the write |
137 // transaction specified by |write_transaction_id|. If they're | 137 // transaction specified by |write_transaction_id|. If they're |
138 // not, that means that the node didn't actually change, but we | 138 // not, that means that the node didn't actually change, but we |
139 // marked them as changed for some other reason (e.g., siblings of | 139 // marked them as changed for some other reason (e.g., siblings of |
140 // re-ordered nodes). | 140 // re-ordered nodes). |
141 // | 141 // |
142 // TODO(sync, long-term): Ideally, ChangeDelegate/Observer would | 142 // TODO(sync, long-term): Ideally, ChangeDelegate/Observer would |
143 // be passed a transformed version of EntryKernelMutation instead | 143 // be passed a transformed version of EntryKernelMutation instead |
144 // of a transaction that would have to be used to look up the | 144 // of a transaction that would have to be used to look up the |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // any remaining unsynced items. May be called on any thread. | 420 // any remaining unsynced items. May be called on any thread. |
421 virtual bool HasUnsyncedItems() = 0; | 421 virtual bool HasUnsyncedItems() = 0; |
422 | 422 |
423 // Returns the SyncManager's encryption handler. | 423 // Returns the SyncManager's encryption handler. |
424 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; | 424 virtual SyncEncryptionHandler* GetEncryptionHandler() = 0; |
425 }; | 425 }; |
426 | 426 |
427 } // namespace syncer | 427 } // namespace syncer |
428 | 428 |
429 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ | 429 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_MANAGER_H_ |
OLD | NEW |