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

Unified Diff: chrome/browser/sync/syncable/model_type.cc

Issue 7745040: [Sync] Make P2PNotifier behave more like InvalidationNotifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix copyright Created 9 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 | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/browser/sync/syncable/model_type_payload_map.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/syncable/model_type.cc
diff --git a/chrome/browser/sync/syncable/model_type.cc b/chrome/browser/sync/syncable/model_type.cc
index 23cb8642e3d6ab264d1e91212938b641d3572a16..8d4227d6d72c40c8a24ec45330d5ed946c309c9d 100644
--- a/chrome/browser/sync/syncable/model_type.cc
+++ b/chrome/browser/sync/syncable/model_type.cc
@@ -314,30 +314,6 @@ std::string ModelTypeBitSetToString(const ModelTypeBitSet& model_types) {
return result;
}
-bool ModelTypeBitSetFromString(
- const std::string& model_type_bitset_string,
- ModelTypeBitSet* model_types) {
- DCHECK(model_types);
- ModelTypeBitSet bitset;
- if (!model_type_bitset_string.empty()) {
- std::vector<std::string> types;
- // Parse the comma-delimited list of types.
- base::SplitString(model_type_bitset_string, ',', &types);
-
- // Walk the list of types and set them in our ModelTypeBitSet.
- for (std::vector<std::string>::const_iterator it = types.begin();
- it != types.end();
- ++it) {
- ModelType type = ModelTypeFromString(*it);
- if (type == UNSPECIFIED)
- return false;
- bitset.set(type);
- }
- }
- *model_types = bitset;
- return true;
-}
-
ModelTypeBitSet ModelTypeBitSetFromSet(const ModelTypeSet& set) {
ModelTypeBitSet bitset;
for (ModelTypeSet::const_iterator iter = set.begin(); iter != set.end();
@@ -375,6 +351,14 @@ ListValue* ModelTypeSetToValue(const ModelTypeSet& model_types) {
return value;
}
+ModelTypeSet ModelTypeSetFromValue(const base::ListValue& value) {
+ ModelTypeSet result;
+ for (ListValue::const_iterator i = value.begin(); i != value.end(); ++i) {
+ result.insert(ModelTypeFromValue(**i));
+ }
+ return result;
+}
+
// TODO(zea): remove all hardcoded tags in model associators and have them use
// this instead.
std::string ModelTypeToRootTag(ModelType type) {
« no previous file with comments | « chrome/browser/sync/syncable/model_type.h ('k') | chrome/browser/sync/syncable/model_type_payload_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698