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

Unified Diff: components/sync_driver/glue/sync_backend_registrar.h

Issue 1848793006: [Sync] Register USS types with ModelTypeRegistry before download (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_driver/glue/sync_backend_registrar.h
diff --git a/components/sync_driver/glue/sync_backend_registrar.h b/components/sync_driver/glue/sync_backend_registrar.h
index 8e3674f3eb37cd0b9e88daafe9d7efbf8a8fc77e..d66eb5b723b11bc8b44b6cc1c9e9bc1e42df6779 100644
--- a/components/sync_driver/glue/sync_backend_registrar.h
+++ b/components/sync_driver/glue/sync_backend_registrar.h
@@ -8,6 +8,7 @@
#include <stdint.h>
#include <map>
+#include <string>
#include <vector>
#include "base/compiler_specific.h"
@@ -67,6 +68,11 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate,
// released.
~SyncBackendRegistrar() override;
+ // Adds |type| to set of non-blocking types. These types will have
+ // GROUP_NON_BLOCKING initial model safe group and would be treated
+ // differently in ModelTypeRegistry.
+ void RegisterNonBlockingType(syncer::ModelType type);
+
// Informs the SyncBackendRegistrar of the currently enabled set of types.
// These types will be placed in the passive group. This function should be
// called exactly once during startup.
@@ -166,6 +172,11 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate,
bool IsOnThreadForGroup(syncer::ModelType type,
syncer::ModelSafeGroup group) const;
+ // Returns model safe group that should be assigned to type when it is first
+ // configured (before activation). Returns GROUP_PASSIVE for directory types
+ // and GROUP_NON_BLOCKING for non-blocking types.
+ syncer::ModelSafeGroup GetInitialGroupForType(syncer::ModelType type) const;
+
// Name used for debugging.
const std::string name_;
@@ -209,6 +220,10 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate,
// workers, etc.
scoped_ptr<base::Thread> sync_thread_;
+ // Set of types with non-blocking implementation (as opposed to directory
+ // based).
+ syncer::ModelTypeSet non_blocking_types_;
+
DISALLOW_COPY_AND_ASSIGN(SyncBackendRegistrar);
};

Powered by Google App Engine
This is Rietveld 408576698