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

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: Fix build. Created 4 years, 8 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..e5c64f710dbcb826fcdad47501e816a1fe4e72cc 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,12 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate,
// released.
~SyncBackendRegistrar() override;
+ // Adds |type| to set of non-blocking types. These types are assigned to
+ // GROUP_NON_BLOCKING model safe group and will be treated differently in
+ // ModelTypeRegistry. Unlike directory types, non-blocking types always stay
+ // assigned to GROUP_NON_BLOCKING group.
+ 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 +173,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 +221,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);
};
« no previous file with comments | « components/sync_driver/glue/sync_backend_host_impl.cc ('k') | components/sync_driver/glue/sync_backend_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698