| Index: sync/notifier/invalidation_util.cc
|
| diff --git a/sync/notifier/invalidation_util.cc b/sync/notifier/invalidation_util.cc
|
| index 5574a8c60ce531be47546db2496c1169b53d1462..2997c8cdec8009d83369771f469fd855db6461b0 100644
|
| --- a/sync/notifier/invalidation_util.cc
|
| +++ b/sync/notifier/invalidation_util.cc
|
| @@ -36,6 +36,33 @@ bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id,
|
| object_id.name(), model_type);
|
| }
|
|
|
| +ObjectIdSet ModelTypeSetToObjectIdSet(const ModelTypeSet& model_types) {
|
| + ObjectIdSet ids;
|
| + for (ModelTypeSet::Iterator iter = model_types.First(); iter.Good();
|
| + iter.Inc()) {
|
| + invalidation::ObjectId model_type_as_id;
|
| + if (!RealModelTypeToObjectId(iter.Get(), &model_type_as_id)) {
|
| + DLOG(WARNING) << "Invalid model type " << iter.Get();
|
| + continue;
|
| + }
|
| + ids.insert(model_type_as_id);
|
| + }
|
| + return ids;
|
| +}
|
| +
|
| +ModelTypeSet ObjectIdSetToModelTypeSet(const ObjectIdSet& ids) {
|
| + ModelTypeSet model_types;
|
| + for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) {
|
| + ModelType model_type;
|
| + if (!ObjectIdToRealModelType(*it, &model_type)) {
|
| + DLOG(WARNING) << "Invalid object ID " << ObjectIdToString(*it);
|
| + continue;
|
| + }
|
| + model_types.Put(model_type);
|
| + }
|
| + return model_types;
|
| +}
|
| +
|
| std::string ObjectIdToString(
|
| const invalidation::ObjectId& object_id) {
|
| std::stringstream ss;
|
|
|