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 // A class to track the outstanding work required to bring the client back into | 5 // A class to track the outstanding work required to bring the client back into |
6 // sync with the server. | 6 // sync with the server. |
7 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_NUDGE_TRACKER_H_ | 7 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_NUDGE_TRACKER_H_ |
8 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_NUDGE_TRACKER_H_ | 8 #define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_NUDGE_TRACKER_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Returns the shortest nudge delay from the tracker of each type in |types|. | 57 // Returns the shortest nudge delay from the tracker of each type in |types|. |
58 base::TimeDelta RecordLocalChange(ModelTypeSet types); | 58 base::TimeDelta RecordLocalChange(ModelTypeSet types); |
59 | 59 |
60 // Takes note of a locally issued request to refresh a data type. | 60 // Takes note of a locally issued request to refresh a data type. |
61 // Returns the current nudge delay for a local refresh. | 61 // Returns the current nudge delay for a local refresh. |
62 base::TimeDelta RecordLocalRefreshRequest(ModelTypeSet types); | 62 base::TimeDelta RecordLocalRefreshRequest(ModelTypeSet types); |
63 | 63 |
64 // Takes note of the receipt of an invalidation notice from the server. | 64 // Takes note of the receipt of an invalidation notice from the server. |
65 // Returns the current nudge delay for a remote invalidation. | 65 // Returns the current nudge delay for a remote invalidation. |
66 base::TimeDelta RecordRemoteInvalidation( | 66 base::TimeDelta RecordRemoteInvalidation( |
67 syncer::ModelType type, | 67 ModelType type, |
68 std::unique_ptr<InvalidationInterface> invalidation); | 68 std::unique_ptr<InvalidationInterface> invalidation); |
69 | 69 |
70 // Take note that an initial sync is pending for this type. | 70 // Take note that an initial sync is pending for this type. |
71 void RecordInitialSyncRequired(syncer::ModelType type); | 71 void RecordInitialSyncRequired(ModelType type); |
72 | 72 |
73 // Takes note that the conflict happended for this type, need to sync to | 73 // Takes note that the conflict happended for this type, need to sync to |
74 // resolve conflict locally. | 74 // resolve conflict locally. |
75 void RecordCommitConflict(syncer::ModelType type); | 75 void RecordCommitConflict(ModelType type); |
76 | 76 |
77 // These functions should be called to keep this class informed of the status | 77 // These functions should be called to keep this class informed of the status |
78 // of the connection to the invalidations server. | 78 // of the connection to the invalidations server. |
79 void OnInvalidationsEnabled(); | 79 void OnInvalidationsEnabled(); |
80 void OnInvalidationsDisabled(); | 80 void OnInvalidationsDisabled(); |
81 | 81 |
82 // Marks |types| as being throttled from |now| until |now| + |length|. | 82 // Marks |types| as being throttled from |now| until |now| + |length|. |
83 void SetTypesThrottledUntil(ModelTypeSet types, | 83 void SetTypesThrottledUntil(ModelTypeSet types, |
84 base::TimeDelta length, | 84 base::TimeDelta length, |
85 base::TimeTicks now); | 85 base::TimeTicks now); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 base::TimeDelta minimum_local_nudge_delay_; | 197 base::TimeDelta minimum_local_nudge_delay_; |
198 base::TimeDelta local_refresh_nudge_delay_; | 198 base::TimeDelta local_refresh_nudge_delay_; |
199 base::TimeDelta remote_invalidation_nudge_delay_; | 199 base::TimeDelta remote_invalidation_nudge_delay_; |
200 | 200 |
201 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); | 201 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); |
202 }; | 202 }; |
203 | 203 |
204 } // namespace syncer | 204 } // namespace syncer |
205 | 205 |
206 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_NUDGE_TRACKER_H_ | 206 #endif // COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_NUDGE_TRACKER_H_ |
OLD | NEW |