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

Side by Side Diff: sync/notifier/object_id_invalidation_map.h

Issue 23754021: Invalidation trickles mega-patch (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_ 5 #ifndef SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_
6 #define SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_ 6 #define SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <vector>
10 10
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" 11 #include "sync/base/sync_export.h"
15 #include "sync/internal_api/public/base/invalidation.h" 12 #include "sync/internal_api/public/base/invalidation.h"
16 #include "sync/notifier/invalidation_util.h" 13 #include "sync/notifier/invalidation_util.h"
17 14 #include "sync/notifier/ordered_invalidation_list.h"
18 namespace base {
19 class ListValue;
20 } // namespace base
21 15
22 namespace syncer { 16 namespace syncer {
23 17
24 typedef std::map<invalidation::ObjectId, 18 class SYNC_EXPORT ObjectIdInvalidationMap {
25 Invalidation, 19 public:
26 ObjectIdLessThan> ObjectIdInvalidationMap; 20 static ObjectIdInvalidationMap InvalidateAll(const ObjectIdSet& ids);
27 21
28 // Converts between ObjectIdInvalidationMaps and ObjectIdSets. 22 ObjectIdInvalidationMap();
29 ObjectIdSet ObjectIdInvalidationMapToSet( 23 ~ObjectIdInvalidationMap();
30 const ObjectIdInvalidationMap& invalidation_map);
31 SYNC_EXPORT ObjectIdInvalidationMap ObjectIdSetToInvalidationMap(
32 const ObjectIdSet& ids, int64 version, const std::string& payload);
33 24
34 SYNC_EXPORT bool ObjectIdInvalidationMapEquals( 25 ObjectIdSet GetObjectIds() const;
35 const ObjectIdInvalidationMap& invalidation_map1, 26 bool Empty() const;
36 const ObjectIdInvalidationMap& invalidation_map2); 27 bool operator==(const ObjectIdInvalidationMap& other) const;
37 28
38 scoped_ptr<base::ListValue> ObjectIdInvalidationMapToValue( 29 void Insert(const Invalidation& invalidation);
39 const ObjectIdInvalidationMap& invalidation_map);
40 30
41 bool ObjectIdInvalidationMapFromValue(const base::ListValue& value, 31 ObjectIdInvalidationMap WithObjects(const ObjectIdSet& ids) const;
42 ObjectIdInvalidationMap* out); 32 const OrderedInvalidationList& ForObject(invalidation::ObjectId id) const;
33 void GetAllInvalidations(std::vector<syncer::Invalidation>* out) const;
34
35 void AcknowledgeAll() const;
36
37 scoped_ptr<base::ListValue> ToValue() const;
38 bool ResetFromValue(const base::ListValue& value);
39
40 std::string ToString() const;
41
42 private:
43 typedef std::map<invalidation::ObjectId,
44 OrderedInvalidationList,
45 ObjectIdLessThan> IdToListMap;
46
47 ObjectIdInvalidationMap(const IdToListMap& map);
48
49 IdToListMap map_;
50 };
43 51
44 } // namespace syncer 52 } // namespace syncer
45 53
46 #endif // SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_ 54 #endif // SYNC_NOTIFIER_OBJECT_ID_INVALIDATION_MAP_H_
OLDNEW
« no previous file with comments | « sync/notifier/non_blocking_invalidator_unittest.cc ('k') | sync/notifier/object_id_invalidation_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698