| OLD | NEW |
| 1 // Copyright 2013 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_SINGLE_OBJECT_INVALIDATION_SET_H_ | 5 #ifndef COMPONENTS_INVALIDATION_SINGLE_OBJECT_INVALIDATION_SET_H_ |
| 6 #define SYNC_NOTIFIER_SINGLE_OBJECT_INVALIDATION_SET_H_ | 6 #define COMPONENTS_INVALIDATION_SINGLE_OBJECT_INVALIDATION_SET_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "sync/base/sync_export.h" | 11 #include "components/invalidation/invalidation_export.h" |
| 12 #include "sync/internal_api/public/base/invalidation.h" | 12 #include "sync/internal_api/public/base/invalidation.h" |
| 13 #include "sync/notifier/invalidation_util.h" | 13 #include "sync/internal_api/public/base/invalidation_util.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class ListValue; | 16 class ListValue; |
| 17 } // namespace base | 17 } // namespace base |
| 18 | 18 |
| 19 namespace syncer { | 19 namespace syncer { |
| 20 | 20 |
| 21 // Holds a list of invalidations that all share the same Object ID. | 21 // Holds a list of invalidations that all share the same Object ID. |
| 22 // | 22 // |
| 23 // The list is kept sorted by version to make it easier to perform common | 23 // The list is kept sorted by version to make it easier to perform common |
| 24 // operations, like checking for an unknown version invalidation or fetching the | 24 // operations, like checking for an unknown version invalidation or fetching the |
| 25 // highest invalidation with the highest version number. | 25 // highest invalidation with the highest version number. |
| 26 class SYNC_EXPORT SingleObjectInvalidationSet { | 26 class INVALIDATION_EXPORT SingleObjectInvalidationSet { |
| 27 public: | 27 public: |
| 28 typedef std::set<Invalidation, InvalidationVersionLessThan> InvalidationsSet; | 28 typedef std::set<Invalidation, InvalidationVersionLessThan> InvalidationsSet; |
| 29 typedef InvalidationsSet::const_iterator const_iterator; | 29 typedef InvalidationsSet::const_iterator const_iterator; |
| 30 typedef InvalidationsSet::const_reverse_iterator const_reverse_iterator; | 30 typedef InvalidationsSet::const_reverse_iterator const_reverse_iterator; |
| 31 | 31 |
| 32 SingleObjectInvalidationSet(); | 32 SingleObjectInvalidationSet(); |
| 33 ~SingleObjectInvalidationSet(); | 33 ~SingleObjectInvalidationSet(); |
| 34 | 34 |
| 35 void Insert(const Invalidation& invalidation); | 35 void Insert(const Invalidation& invalidation); |
| 36 void InsertAll(const SingleObjectInvalidationSet& other); | 36 void InsertAll(const SingleObjectInvalidationSet& other); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 54 | 54 |
| 55 scoped_ptr<base::ListValue> ToValue() const; | 55 scoped_ptr<base::ListValue> ToValue() const; |
| 56 bool ResetFromValue(const base::ListValue& list); | 56 bool ResetFromValue(const base::ListValue& list); |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 InvalidationsSet invalidations_; | 59 InvalidationsSet invalidations_; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // syncer | 62 } // syncer |
| 63 | 63 |
| 64 #endif // SYNC_NOTIFIER_SINGLE_OBJECT_INVALIDATION_SET_H_ | 64 #endif // COMPONENTS_INVALIDATION_SINGLE_OBJECT_INVALIDATION_SET_H_ |
| OLD | NEW |