OLD | NEW |
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 // Various utilities for dealing with invalidation data types. | 5 // Various utilities for dealing with invalidation data types. |
6 | 6 |
7 #ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | 7 #ifndef SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |
8 #define SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | 8 #define SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 namespace syncer { | 23 namespace syncer { |
24 | 24 |
25 struct ObjectIdLessThan { | 25 struct ObjectIdLessThan { |
26 bool operator()(const invalidation::ObjectId& lhs, | 26 bool operator()(const invalidation::ObjectId& lhs, |
27 const invalidation::ObjectId& rhs) const; | 27 const invalidation::ObjectId& rhs) const; |
28 }; | 28 }; |
29 | 29 |
30 typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet; | 30 typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet; |
31 | 31 |
| 32 // TODO(dcheng): Should ModelType stuff be factored out of here? |
32 bool RealModelTypeToObjectId(syncer::ModelType model_type, | 33 bool RealModelTypeToObjectId(syncer::ModelType model_type, |
33 invalidation::ObjectId* object_id); | 34 invalidation::ObjectId* object_id); |
34 | 35 |
35 bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, | 36 bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, |
36 syncer::ModelType* model_type); | 37 syncer::ModelType* model_type); |
37 | 38 |
| 39 ObjectIdSet ModelTypeSetToObjectIdSet(const ModelTypeSet& models); |
| 40 ModelTypeSet ObjectIdSetToModelTypeSet(const ObjectIdSet& ids); |
| 41 |
38 std::string ObjectIdToString(const invalidation::ObjectId& object_id); | 42 std::string ObjectIdToString(const invalidation::ObjectId& object_id); |
39 | 43 |
40 std::string InvalidationToString( | 44 std::string InvalidationToString( |
41 const invalidation::Invalidation& invalidation); | 45 const invalidation::Invalidation& invalidation); |
42 | 46 |
43 } // namespace syncer | 47 } // namespace syncer |
44 | 48 |
45 #endif // SYNC_NOTIFIER_INVALIDATION_UTIL_H_ | 49 #endif // SYNC_NOTIFIER_INVALIDATION_UTIL_H_ |
OLD | NEW |