OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_LISTENER_H_ | |
6 #define CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_LISTENER_H_ | |
7 #pragma once | |
8 | |
9 #include "chrome/browser/sync/syncable/model_type.h" | |
10 #include "chrome/browser/sync/syncable/syncable.h" | |
11 | |
12 namespace syncable { | |
13 | |
14 // This is an interface for listening to directory change events, triggered by | |
15 // the releasing of the syncable transaction. The listener performs work to | |
16 // 1. Calculate changes, depending on the source of the transaction | |
17 // (HandleCalculateChangesChangeEventFromSyncer/Syncapi). | |
18 // 2. Perform final work while the transaction is held | |
19 // (HandleTransactionEndingChangeEvent). | |
20 // 3. Perform any work that should be done after the transaction is released. | |
21 // (HandleTransactionCompleteChangeEvent). | |
22 class DirectoryChangeListener { | |
23 public: | |
24 virtual void HandleCalculateChangesChangeEventFromSyncApi( | |
25 const OriginalEntries& originals, | |
26 const WriterTag& writer, | |
27 BaseTransaction* trans) = 0; | |
28 virtual void HandleCalculateChangesChangeEventFromSyncer( | |
29 const OriginalEntries& originals, | |
30 const WriterTag& writer, | |
31 BaseTransaction* trans) = 0; | |
32 virtual ModelTypeBitSet HandleTransactionEndingChangeEvent( | |
33 BaseTransaction* trans) = 0; | |
34 virtual void HandleTransactionCompleteChangeEvent( | |
35 const ModelTypeBitSet& models_with_changes) = 0; | |
36 protected: | |
37 virtual ~DirectoryChangeListener() {} | |
38 }; | |
39 | |
40 } // namespace syncable | |
41 | |
42 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_CHANGE_LISTENER_H_ | |
OLD | NEW |