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 // An InvalidationStateTracker is an interface that handles persisting state | 5 // An InvalidationStateTracker is an interface that handles persisting state |
6 // needed for invalidations. Currently, it is responsible for managing the | 6 // needed for invalidations. Currently, it is responsible for managing the |
7 // following information: | 7 // following information: |
8 // - Max version seen from the invalidation server to help dedupe invalidations. | 8 // - Max version seen from the invalidation server to help dedupe invalidations. |
9 // - Bootstrap data for the invalidation client. | 9 // - Bootstrap data for the invalidation client. |
10 // - Payloads and locally generated ack handles, to support local acking. | 10 // - Payloads and locally generated ack handles, to support local acking. |
11 | 11 |
12 #ifndef COMPONENTS_INVALIDATION_IMPL_INVALIDATION_STATE_TRACKER_H_ | 12 #ifndef COMPONENTS_INVALIDATION_IMPL_INVALIDATION_STATE_TRACKER_H_ |
13 #define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_STATE_TRACKER_H_ | 13 #define COMPONENTS_INVALIDATION_IMPL_INVALIDATION_STATE_TRACKER_H_ |
14 | 14 |
15 #include <map> | 15 #include <map> |
16 #include <string> | 16 #include <string> |
17 | 17 |
18 #include "base/callback_forward.h" | 18 #include "base/callback_forward.h" |
19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "components/invalidation/impl/unacked_invalidation_set.h" | 20 #include "components/invalidation/impl/unacked_invalidation_set.h" |
21 #include "components/invalidation/public/invalidation.h" | 21 #include "components/invalidation/public/invalidation.h" |
22 #include "components/invalidation/public/invalidation_export.h" | 22 #include "components/invalidation/public/invalidation_export.h" |
23 #include "components/invalidation/public/invalidation_util.h" | 23 #include "components/invalidation/public/invalidation_util.h" |
24 #include "google/cacheinvalidation/include/types.h" | 24 #include "google/cacheinvalidation/include/types.h" |
25 | 25 |
26 namespace base { | |
27 class TaskRunner; | |
28 } // namespace base | |
29 | |
30 namespace syncer { | 26 namespace syncer { |
31 | 27 |
32 class INVALIDATION_EXPORT InvalidationStateTracker { | 28 class INVALIDATION_EXPORT InvalidationStateTracker { |
33 public: | 29 public: |
34 InvalidationStateTracker(); | 30 InvalidationStateTracker(); |
35 virtual ~InvalidationStateTracker(); | 31 virtual ~InvalidationStateTracker(); |
36 | 32 |
37 // The per-client unique ID used to register the invalidation client with the | 33 // The per-client unique ID used to register the invalidation client with the |
38 // server. This is used to squelch invalidation notifications that originate | 34 // server. This is used to squelch invalidation notifications that originate |
39 // from changes made by this client. Setting the client ID clears all other | 35 // from changes made by this client. Setting the client ID clears all other |
(...skipping 14 matching lines...) Expand all Loading... |
54 virtual void SetSavedInvalidations(const UnackedInvalidationsMap& states) = 0; | 50 virtual void SetSavedInvalidations(const UnackedInvalidationsMap& states) = 0; |
55 virtual UnackedInvalidationsMap GetSavedInvalidations() const = 0; | 51 virtual UnackedInvalidationsMap GetSavedInvalidations() const = 0; |
56 | 52 |
57 // Erases invalidation versions, client ID, and state stored on disk. | 53 // Erases invalidation versions, client ID, and state stored on disk. |
58 virtual void Clear() = 0; | 54 virtual void Clear() = 0; |
59 }; | 55 }; |
60 | 56 |
61 } // namespace syncer | 57 } // namespace syncer |
62 | 58 |
63 #endif // COMPONENTS_INVALIDATION_IMPL_INVALIDATION_STATE_TRACKER_H_ | 59 #endif // COMPONENTS_INVALIDATION_IMPL_INVALIDATION_STATE_TRACKER_H_ |
OLD | NEW |