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

Unified Diff: sync/internal_api/public/base/model_type.h

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ToFullModelTypeSet() function Created 8 years, 4 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
« no previous file with comments | « sync/engine/syncer_util.cc ('k') | sync/internal_api/public/sync_encryption_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/public/base/model_type.h
diff --git a/sync/internal_api/public/base/model_type.h b/sync/internal_api/public/base/model_type.h
index 20c8ffa19d0a37d860e9170c706d7e58dca0bcba..8037e546ff8d5308a3b950e5b5a75173c5d1f282 100644
--- a/sync/internal_api/public/base/model_type.h
+++ b/sync/internal_api/public/base/model_type.h
@@ -52,7 +52,8 @@ enum ModelType {
//
// A bookmark folder or a bookmark URL object.
BOOKMARKS,
- FIRST_REAL_MODEL_TYPE = BOOKMARKS, // Declared 2nd, for debugger prettiness.
+ FIRST_USER_MODEL_TYPE = BOOKMARKS, // Declared 2nd, for debugger prettiness.
+ FIRST_REAL_MODEL_TYPE = FIRST_USER_MODEL_TYPE,
// A preference folder or a preference object.
PREFERENCES,
@@ -69,8 +70,6 @@ enum ModelType {
TYPED_URLS,
// An extension folder or an extension object.
EXTENSIONS,
- // An object representing a set of Nigori keys.
- NIGORI,
// An object representing a custom search engine.
SEARCH_ENGINES,
// An object representing a browser session.
@@ -83,7 +82,14 @@ enum ModelType {
EXTENSION_SETTINGS,
// App notifications.
APP_NOTIFICATIONS,
- LAST_REAL_MODEL_TYPE = APP_NOTIFICATIONS,
+ LAST_USER_MODEL_TYPE = APP_NOTIFICATIONS,
+
+ // An object representing a set of Nigori keys.
+ NIGORI,
+ FIRST_CONTROL_MODEL_TYPE = NIGORI,
+ LAST_CONTROL_MODEL_TYPE = NIGORI,
+
+ LAST_REAL_MODEL_TYPE = LAST_CONTROL_MODEL_TYPE,
// If you are adding a new sync datatype that is exposed to the user via the
// sync preferences UI, be sure to update the list in
@@ -124,6 +130,27 @@ SYNC_EXPORT ModelType GetModelTypeFromSpecifics(
// value (sibling ordering) for this item.
bool ShouldMaintainPosition(ModelType model_type);
+// These are the user-selectable data types. Note that some of these share a
+// preference flag, so not all of them are individually user-selectable.
+ModelTypeSet UserTypes();
+
+// Returns a list of all control types.
+//
+// The control types are intended to contain metadata nodes that are essential
+// for the normal operation of the syncer. As such, they have the following
+// special properties:
+// - They are downloaded early during SyncBackend initialization.
+// - They are always enabled. Users may not disable these types.
+// - Their contents are not encrypted automatically.
+// - They support custom update application and conflict resolution logic.
+// - All change processing occurs on the sync thread (GROUP_PASSIVE).
+ModelTypeSet ControlTypes();
+
+// Returns true if this is a control type.
+//
+// See comment above for more information on what makes these types special.
+bool IsControlType(ModelType model_type);
+
// Determine a model type from the field number of its associated
// EntitySpecifics field.
ModelType GetModelTypeFromSpecificsFieldNumber(int field_number);
@@ -135,6 +162,8 @@ ModelType GetModelTypeFromSpecificsFieldNumber(int field_number);
SYNC_EXPORT int GetSpecificsFieldNumberFromModelType(
ModelType model_type);
+FullModelTypeSet ToFullModelTypeSet(ModelTypeSet in);
tim (not reviewing) 2012/08/31 00:06:10 const ModelTypeSet& in
rlarocque 2012/08/31 00:12:43 That's what I thought, too, but Fred reminded me t
+
// TODO(sync): The functions below badly need some cleanup.
// Returns a pointer to a string with application lifetime that represents
« no previous file with comments | « sync/engine/syncer_util.cc ('k') | sync/internal_api/public/sync_encryption_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698