OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SYNC_BASE_INVALIDATION_INTERFACE_H_ | 5 #ifndef COMPONENTS_SYNC_BASE_INVALIDATION_INTERFACE_H_ |
6 #define COMPONENTS_SYNC_BASE_INVALIDATION_INTERFACE_H_ | 6 #define COMPONENTS_SYNC_BASE_INVALIDATION_INTERFACE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "components/sync/base/sync_export.h" | |
13 | |
14 namespace syncer { | 12 namespace syncer { |
15 | 13 |
16 // An interface that wraps sync's interactions with the component that provides | 14 // An interface that wraps sync's interactions with the component that provides |
17 // it with invalidations. | 15 // it with invalidations. |
18 class SYNC_EXPORT InvalidationInterface { | 16 class InvalidationInterface { |
19 public: | 17 public: |
20 // Orders invalidations based on version number and IsUnknownVersion(). | 18 // Orders invalidations based on version number and IsUnknownVersion(). |
21 static bool LessThanByVersion(const InvalidationInterface& a, | 19 static bool LessThanByVersion(const InvalidationInterface& a, |
22 const InvalidationInterface& b); | 20 const InvalidationInterface& b); |
23 | 21 |
24 InvalidationInterface(); | 22 InvalidationInterface(); |
25 virtual ~InvalidationInterface(); | 23 virtual ~InvalidationInterface(); |
26 | 24 |
27 // Returns true if this is an 'unknown version' invalidation. | 25 // Returns true if this is an 'unknown version' invalidation. |
28 // Such invalidations have no valid payload or version number. | 26 // Such invalidations have no valid payload or version number. |
(...skipping 18 matching lines...) Expand all Loading... |
47 // drop this invalidation. | 45 // drop this invalidation. |
48 // | 46 // |
49 // To indicate recovery from a drop event, the receiver of this invalidation | 47 // To indicate recovery from a drop event, the receiver of this invalidation |
50 // will call Acknowledge() on the most recently dropped invalidation. | 48 // will call Acknowledge() on the most recently dropped invalidation. |
51 virtual void Drop() = 0; | 49 virtual void Drop() = 0; |
52 }; | 50 }; |
53 | 51 |
54 } // namespace syncer | 52 } // namespace syncer |
55 | 53 |
56 #endif // COMPONENTS_SYNC_BASE_INVALIDATION_INTERFACE_H_ | 54 #endif // COMPONENTS_SYNC_BASE_INVALIDATION_INTERFACE_H_ |
OLD | NEW |