Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: sync/syncable/directory_change_delegate.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sync/syncable/directory_backing_store_unittest.cc ('k') | sync/syncable/directory_unittest.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_
6 #define SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_
7
8 #include <stdint.h>
9
10 #include <vector>
11
12 #include "sync/base/sync_export.h"
13 #include "sync/internal_api/public/base/model_type.h"
14 #include "sync/syncable/write_transaction_info.h"
15
16 namespace syncer {
17 namespace syncable {
18
19 // This is an interface for listening to directory change events, triggered by
20 // the releasing of the syncable transaction. The delegate performs work to
21 // 1. Calculate changes, depending on the source of the transaction
22 // (HandleCalculateChangesChangeEventFromSyncer/Syncapi).
23 // 2. Perform final work while the transaction is held
24 // (HandleTransactionEndingChangeEvent).
25 // 3. Perform any work that should be done after the transaction is released.
26 // (HandleTransactionCompleteChangeEvent).
27 //
28 // Note that these methods may be called on *any* thread.
29 class SYNC_EXPORT DirectoryChangeDelegate {
30 public:
31 // Returns the handles of changed entries in |entry_changed|.
32 virtual void HandleCalculateChangesChangeEventFromSyncApi(
33 const ImmutableWriteTransactionInfo& write_transaction_info,
34 BaseTransaction* trans,
35 std::vector<int64_t>* entries_changed) = 0;
36 // Returns the handles of changed entries in |entry_changed|.
37 virtual void HandleCalculateChangesChangeEventFromSyncer(
38 const ImmutableWriteTransactionInfo& write_transaction_info,
39 BaseTransaction* trans,
40 std::vector<int64_t>* entries_changed) = 0;
41 // Must return the set of all ModelTypes that were modified in the
42 // transaction.
43 virtual ModelTypeSet HandleTransactionEndingChangeEvent(
44 const ImmutableWriteTransactionInfo& write_transaction_info,
45 BaseTransaction* trans) = 0;
46 virtual void HandleTransactionCompleteChangeEvent(
47 ModelTypeSet models_with_changes) = 0;
48 protected:
49 virtual ~DirectoryChangeDelegate() {}
50 };
51
52 } // namespace syncable
53 } // namespace syncer
54
55 #endif // SYNC_SYNCABLE_DIRECTORY_CHANGE_DELEGATE_H_
OLDNEW
« no previous file with comments | « sync/syncable/directory_backing_store_unittest.cc ('k') | sync/syncable/directory_unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698