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

Side by Side Diff: components/sync/base/model_type.h

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Rebase Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef COMPONENTS_SYNC_BASE_MODEL_TYPE_H_ 5 #ifndef COMPONENTS_SYNC_BASE_MODEL_TYPE_H_
6 #define COMPONENTS_SYNC_BASE_MODEL_TYPE_H_ 6 #define COMPONENTS_SYNC_BASE_MODEL_TYPE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <ostream> 10 #include <ostream>
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 // Returns a pointer to a string with application lifetime that represents 278 // Returns a pointer to a string with application lifetime that represents
279 // the name of |model_type|. 279 // the name of |model_type|.
280 const char* ModelTypeToString(ModelType model_type); 280 const char* ModelTypeToString(ModelType model_type);
281 281
282 // Some histograms take an integer parameter that represents a model type. 282 // Some histograms take an integer parameter that represents a model type.
283 // The mapping from ModelType to integer is defined here. It should match 283 // The mapping from ModelType to integer is defined here. It should match
284 // the mapping from integer to labels defined in histograms.xml. 284 // the mapping from integer to labels defined in histograms.xml.
285 int ModelTypeToHistogramInt(ModelType model_type); 285 int ModelTypeToHistogramInt(ModelType model_type);
286 286
287 // Handles all model types, and not just real ones. 287 // Handles all model types, and not just real ones.
288 // 288 //
vabr (Chromium) 2017/06/01 19:53:33 nit: The empty comment line seems unnecessary. It
jdoerrie 2017/06/02 09:39:56 Done.
289 // Caller takes ownership of returned value. 289 std::unique_ptr<base::Value> ModelTypeToValue(ModelType model_type);
290 base::Value* ModelTypeToValue(ModelType model_type);
291 290
292 // Converts a Value into a ModelType - complement to ModelTypeToValue(). 291 // Converts a Value into a ModelType - complement to ModelTypeToValue().
293 ModelType ModelTypeFromValue(const base::Value& value); 292 ModelType ModelTypeFromValue(const base::Value& value);
294 293
295 // Returns the ModelType corresponding to the name |model_type_string|. 294 // Returns the ModelType corresponding to the name |model_type_string|.
296 ModelType ModelTypeFromString(const std::string& model_type_string); 295 ModelType ModelTypeFromString(const std::string& model_type_string);
297 296
298 // Returns the comma-separated string representation of |model_types|. 297 // Returns the comma-separated string representation of |model_types|.
299 std::string ModelTypeSetToString(ModelTypeSet model_types); 298 std::string ModelTypeSetToString(ModelTypeSet model_types);
300 299
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 350
352 // Returns true if |model_type| supports parent-child hierarchy or entries. 351 // Returns true if |model_type| supports parent-child hierarchy or entries.
353 bool TypeSupportsHierarchy(ModelType model_type); 352 bool TypeSupportsHierarchy(ModelType model_type);
354 353
355 // Returns true if |model_type| supports ordering of sibling entries. 354 // Returns true if |model_type| supports ordering of sibling entries.
356 bool TypeSupportsOrdering(ModelType model_type); 355 bool TypeSupportsOrdering(ModelType model_type);
357 356
358 } // namespace syncer 357 } // namespace syncer
359 358
360 #endif // COMPONENTS_SYNC_BASE_MODEL_TYPE_H_ 359 #endif // COMPONENTS_SYNC_BASE_MODEL_TYPE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698