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

Side by Side Diff: sync/internal_api/public/base/model_type.h

Issue 11485019: [Sync] Add tests for invalid specifics field number handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Enumerate the various item subtypes that are supported by sync. 5 // Enumerate the various item subtypes that are supported by sync.
6 // Each sync object is expected to have an immutable object type. 6 // Each sync object is expected to have an immutable object type.
7 // An object's type is inferred from the type of data it holds. 7 // An object's type is inferred from the type of data it holds.
8 8
9 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_H_ 9 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_H_
10 #define SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_H_ 10 #define SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_H_
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // following pattern: 167 // following pattern:
168 // 168 //
169 // ModelTypeSet model_types; 169 // ModelTypeSet model_types;
170 // // Say we're looping through a list of items, each of which has a 170 // // Say we're looping through a list of items, each of which has a
171 // // field number. 171 // // field number.
172 // for (...) { 172 // for (...) {
173 // int field_number = ...; 173 // int field_number = ...;
174 // ModelType model_type = 174 // ModelType model_type =
175 // GetModelTypeFromSpecificsFieldNumber(field_number); 175 // GetModelTypeFromSpecificsFieldNumber(field_number);
176 // if (!IsRealDataType(model_type)) { 176 // if (!IsRealDataType(model_type)) {
177 // NOTREACHED() << "Unknown field number " << field_number; 177 // DLOG(WARNING) << "Unknown field number " << field_number;
178 // continue; 178 // continue;
179 // } 179 // }
180 // model_types.Put(model_type); 180 // model_types.Put(model_type);
181 // } 181 // }
182 ModelType GetModelTypeFromSpecificsFieldNumber(int field_number); 182 ModelType GetModelTypeFromSpecificsFieldNumber(int field_number);
183 183
184 // Return the field number of the EntitySpecifics field associated with 184 // Return the field number of the EntitySpecifics field associated with
185 // a model type. 185 // a model type.
186 // 186 //
187 // Used by tests outside of sync. 187 // Used by tests outside of sync.
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // type and |model_type| was filled in. 230 // type and |model_type| was filled in.
231 bool NotificationTypeToRealModelType(const std::string& notification_type, 231 bool NotificationTypeToRealModelType(const std::string& notification_type,
232 ModelType* model_type); 232 ModelType* model_type);
233 233
234 // Returns true if |model_type| is a real datatype 234 // Returns true if |model_type| is a real datatype
235 SYNC_EXPORT bool IsRealDataType(ModelType model_type); 235 SYNC_EXPORT bool IsRealDataType(ModelType model_type);
236 236
237 } // namespace syncer 237 } // namespace syncer
238 238
239 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_H_ 239 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698