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

Unified Diff: components/sync/engine_impl/uss_migrator.h

Issue 2442583003: [Sync] Start implementation of migration for USS. (Closed)
Patch Set: Rebase. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/engine_impl/uss_migrator.h
diff --git a/components/sync/engine_impl/uss_migrator.h b/components/sync/engine_impl/uss_migrator.h
new file mode 100644
index 0000000000000000000000000000000000000000..28cdddb44535f3c8b693fa8f09973b0620472f0f
--- /dev/null
+++ b/components/sync/engine_impl/uss_migrator.h
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_
+#define COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_
+
+#include "base/callback.h"
+#include "components/sync/base/model_type.h"
+
+namespace syncer {
+
+class ModelTypeWorker;
+struct UserShare;
+
+typedef base::Callback<bool(ModelType, UserShare*, ModelTypeWorker*)>
+ UssMigrator;
+
+// Pulls all the data for |type| out of the directory and sends it to |worker|
+// as the result of an initial GetUpdates. Returns whether migration succeeded.
+bool MigrateDirectoryData(ModelType type,
+ UserShare* user_share,
+ ModelTypeWorker* worker);
+
+// A version of the above with |batch_size| as a parameter so it can be lowered
+// for unit testing.
+bool MigrateDirectoryDataWithBatchSize(ModelType type,
+ UserShare* user_share,
+ ModelTypeWorker* worker,
+ int batch_size);
+
+} // namespace syncer
+
+#endif // COMPONENTS_SYNC_ENGINE_IMPL_USS_MIGRATOR_H_

Powered by Google App Engine
This is Rietveld 408576698