OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_ENGINE_IMPL_USS_MIGRATOR_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_ |
6 #define COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "components/sync/base/model_type.h" | 9 #include "components/sync/base/model_type.h" |
10 | 10 |
11 namespace syncer { | 11 namespace syncer { |
12 | 12 |
13 class ModelTypeWorker; | 13 class ModelTypeWorker; |
14 struct UserShare; | 14 struct UserShare; |
15 | 15 |
16 typedef base::Callback<bool(ModelType, UserShare*, ModelTypeWorker*)> | 16 using UssMigrator = |
17 UssMigrator; | 17 base::Callback<bool(ModelType, UserShare*, ModelTypeWorker*)>; |
18 | 18 |
19 // Pulls all the data for |type| out of the directory and sends it to |worker| | 19 // Pulls all the data for |type| out of the directory and sends it to |worker| |
20 // as the result of an initial GetUpdates. Returns whether migration succeeded. | 20 // as the result of an initial GetUpdates. Returns whether migration succeeded. |
21 bool MigrateDirectoryData(ModelType type, | 21 bool MigrateDirectoryData(ModelType type, |
22 UserShare* user_share, | 22 UserShare* user_share, |
23 ModelTypeWorker* worker); | 23 ModelTypeWorker* worker); |
24 | 24 |
25 // A version of the above with |batch_size| as a parameter so it can be lowered | 25 // A version of the above with |batch_size| as a parameter so it can be lowered |
26 // for unit testing. | 26 // for unit testing. |
27 bool MigrateDirectoryDataWithBatchSize(ModelType type, | 27 bool MigrateDirectoryDataWithBatchSize(ModelType type, |
28 UserShare* user_share, | 28 UserShare* user_share, |
29 ModelTypeWorker* worker, | 29 ModelTypeWorker* worker, |
30 int batch_size); | 30 int batch_size); |
31 | 31 |
32 } // namespace syncer | 32 } // namespace syncer |
33 | 33 |
34 #endif // COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_ | 34 #endif // COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_ |
OLD | NEW |