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
3 // found in the LICENSE file.
5 #ifndef SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_
6 #define SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "google/cacheinvalidation/include/types.h"
14 #include "sync/base/sync_export.h"
15 #include "sync/internal_api/public/base/invalidation.h"
16 #include "sync/internal_api/public/base/model_type_invalidation_map.h"
17 #include "sync/notifier/invalidation_util.h"
25 typedef std::map
<invalidation::ObjectId
,
27 ObjectIdLessThan
> ObjectIdInvalidationMap
;
29 // Converts between ObjectIdInvalidationMaps and ObjectIdSets.
30 ObjectIdSet
ObjectIdInvalidationMapToSet(
31 const ObjectIdInvalidationMap
& invalidation_map
);
32 SYNC_EXPORT ObjectIdInvalidationMap
ObjectIdSetToInvalidationMap(
33 const ObjectIdSet
& ids
, int64 version
, const std::string
& payload
);
35 SYNC_EXPORT
bool ObjectIdInvalidationMapEquals(
36 const ObjectIdInvalidationMap
& invalidation_map1
,
37 const ObjectIdInvalidationMap
& invalidation_map2
);
39 scoped_ptr
<base::ListValue
> ObjectIdInvalidationMapToValue(
40 const ObjectIdInvalidationMap
& invalidation_map
);
42 bool ObjectIdInvalidationMapFromValue(const base::ListValue
& value
,
43 ObjectIdInvalidationMap
* out
);
45 // Converts between ObjectIdInvalidationMaps and ModelTypeInvalidationMaps.
46 SYNC_EXPORT_PRIVATE ModelTypeInvalidationMap
47 ObjectIdInvalidationMapToModelTypeInvalidationMap(
48 const ObjectIdInvalidationMap
& invalidation_map
);
49 SYNC_EXPORT ObjectIdInvalidationMap
50 ModelTypeInvalidationMapToObjectIdInvalidationMap(
51 const ModelTypeInvalidationMap
& invalidation_map
);
55 #endif // SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_