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_CHANGE_PROCESSOR_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_ |
6 #define COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_ | 6 #define COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include "base/macros.h" |
8 #include "components/sync_driver/data_type_error_handler.h" | 11 #include "components/sync_driver/data_type_error_handler.h" |
9 #include "sync/internal_api/public/base_transaction.h" | 12 #include "sync/internal_api/public/base_transaction.h" |
10 #include "sync/internal_api/public/change_record.h" | 13 #include "sync/internal_api/public/change_record.h" |
11 #include "sync/internal_api/public/user_share.h" | 14 #include "sync/internal_api/public/user_share.h" |
12 | 15 |
13 namespace syncer { | 16 namespace syncer { |
14 class UnrecoverableErrorHandler; | 17 class UnrecoverableErrorHandler; |
15 } // namespace syncer | 18 } // namespace syncer |
16 | 19 |
17 namespace sync_driver { | 20 namespace sync_driver { |
(...skipping 11 matching lines...) Expand all Loading... |
29 // and apply them to the other. Both the native model and sync_api are | 32 // and apply them to the other. Both the native model and sync_api are |
30 // expected to be initialized and loaded. You must have set a valid | 33 // expected to be initialized and loaded. You must have set a valid |
31 // ModelAssociator and UnrecoverableErrorHandler before using this method, and | 34 // ModelAssociator and UnrecoverableErrorHandler before using this method, and |
32 // the two models should be associated w.r.t the ModelAssociator provided. | 35 // the two models should be associated w.r.t the ModelAssociator provided. |
33 void Start(syncer::UserShare* share_handle); | 36 void Start(syncer::UserShare* share_handle); |
34 | 37 |
35 // Changes have been applied to the backend model and are ready to be | 38 // Changes have been applied to the backend model and are ready to be |
36 // applied to the frontend model. | 39 // applied to the frontend model. |
37 virtual void ApplyChangesFromSyncModel( | 40 virtual void ApplyChangesFromSyncModel( |
38 const syncer::BaseTransaction* trans, | 41 const syncer::BaseTransaction* trans, |
39 int64 model_version, | 42 int64_t model_version, |
40 const syncer::ImmutableChangeRecordList& changes) = 0; | 43 const syncer::ImmutableChangeRecordList& changes) = 0; |
41 | 44 |
42 // The changes found in ApplyChangesFromSyncModel may be too slow to be | 45 // The changes found in ApplyChangesFromSyncModel may be too slow to be |
43 // performed while holding a [Read/Write]Transaction lock or may interact | 46 // performed while holding a [Read/Write]Transaction lock or may interact |
44 // with another thread, which might itself be waiting on the transaction lock, | 47 // with another thread, which might itself be waiting on the transaction lock, |
45 // putting us at risk of deadlock. | 48 // putting us at risk of deadlock. |
46 // This function is called once the transactional lock is released and it is | 49 // This function is called once the transactional lock is released and it is |
47 // safe to perform inter-thread or slow I/O operations. Note that not all | 50 // safe to perform inter-thread or slow I/O operations. Note that not all |
48 // datatypes need this, so we provide an empty default version. | 51 // datatypes need this, so we provide an empty default version. |
49 virtual void CommitChangesFromSyncModel(); | 52 virtual void CommitChangesFromSyncModel(); |
(...skipping 29 matching lines...) Expand all Loading... |
79 | 82 |
80 // The sync model we are processing changes from. | 83 // The sync model we are processing changes from. |
81 syncer::UserShare* share_handle_; | 84 syncer::UserShare* share_handle_; |
82 | 85 |
83 DISALLOW_COPY_AND_ASSIGN(ChangeProcessor); | 86 DISALLOW_COPY_AND_ASSIGN(ChangeProcessor); |
84 }; | 87 }; |
85 | 88 |
86 } // namespace sync_driver | 89 } // namespace sync_driver |
87 | 90 |
88 #endif // COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_ | 91 #endif // COMPONENTS_SYNC_DRIVER_CHANGE_PROCESSOR_H_ |
OLD | NEW |