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

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

Issue 11533014: Merge 172232 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 8 years 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_proto_util.cc ('k') | sync/syncable/model_type.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
===================================================================
--- sync/internal_api/public/base/model_type.h (revision 172388)
+++ sync/internal_api/public/base/model_type.h (working copy)
@@ -160,7 +160,25 @@
bool IsControlType(ModelType model_type);
// Determine a model type from the field number of its associated
-// EntitySpecifics field.
+// EntitySpecifics field. Returns UNSPECIFIED if the field number is
+// not recognized.
+//
+// If you're putting the result in a ModelTypeSet, you should use the
+// following pattern:
+//
+// ModelTypeSet model_types;
+// // Say we're looping through a list of items, each of which has a
+// // field number.
+// for (...) {
+// int field_number = ...;
+// ModelType model_type =
+// GetModelTypeFromSpecificsFieldNumber(field_number);
+// if (!IsRealDataType(model_type)) {
+// NOTREACHED() << "Unknown field number " << field_number;
+// continue;
+// }
+// model_types.Put(model_type);
+// }
ModelType GetModelTypeFromSpecificsFieldNumber(int field_number);
// Return the field number of the EntitySpecifics field associated with
« no previous file with comments | « sync/engine/syncer_proto_util.cc ('k') | sync/syncable/model_type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698