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 SYNC_SESSIONS_NUDGE_TRACKER_H_ | 7 #ifndef SYNC_SESSIONS_NUDGE_TRACKER_H_ |
8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_ | 8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_ |
9 | 9 |
10 #include <list> | 10 #include <list> |
11 #include <map> | 11 #include <map> |
12 | 12 |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "sync/base/sync_export.h" | 14 #include "sync/base/sync_export.h" |
15 #include "sync/internal_api/public/base/model_type.h" | 15 #include "sync/internal_api/public/base/model_type.h" |
16 #include "sync/internal_api/public/base/model_type_invalidation_map.h" | 16 #include "sync/notifier/object_id_invalidation_map.h" |
17 #include "sync/protocol/sync.pb.h" | 17 #include "sync/protocol/sync.pb.h" |
18 #include "sync/sessions/data_type_tracker.h" | 18 #include "sync/sessions/data_type_tracker.h" |
19 | 19 |
20 namespace syncer { | 20 namespace syncer { |
21 namespace sessions { | 21 namespace sessions { |
22 | 22 |
23 class SYNC_EXPORT_PRIVATE NudgeTracker { | 23 class SYNC_EXPORT_PRIVATE NudgeTracker { |
24 public: | 24 public: |
25 static size_t kDefaultMaxPayloadsPerType; | 25 static size_t kDefaultMaxPayloadsPerType; |
26 | 26 |
(...skipping 14 matching lines...) Expand all Loading... |
41 void RecordSuccessfulSyncCycle(); | 41 void RecordSuccessfulSyncCycle(); |
42 | 42 |
43 // Takes note of a local change. | 43 // Takes note of a local change. |
44 void RecordLocalChange(ModelTypeSet types); | 44 void RecordLocalChange(ModelTypeSet types); |
45 | 45 |
46 // Takes note of a locally issued request to refresh a data type. | 46 // Takes note of a locally issued request to refresh a data type. |
47 void RecordLocalRefreshRequest(ModelTypeSet types); | 47 void RecordLocalRefreshRequest(ModelTypeSet types); |
48 | 48 |
49 // Takes note of the receipt of an invalidation notice from the server. | 49 // Takes note of the receipt of an invalidation notice from the server. |
50 void RecordRemoteInvalidation( | 50 void RecordRemoteInvalidation( |
51 const ModelTypeInvalidationMap& invalidation_map); | 51 const ObjectIdInvalidationMap& invalidation_map); |
52 | 52 |
53 // These functions should be called to keep this class informed of the status | 53 // These functions should be called to keep this class informed of the status |
54 // of the connection to the invalidations server. | 54 // of the connection to the invalidations server. |
55 void OnInvalidationsEnabled(); | 55 void OnInvalidationsEnabled(); |
56 void OnInvalidationsDisabled(); | 56 void OnInvalidationsDisabled(); |
57 | 57 |
58 // Marks |types| as being throttled from |now| until |now| + |length|. | 58 // Marks |types| as being throttled from |now| until |now| + |length|. |
59 void SetTypesThrottledUntil(ModelTypeSet types, | 59 void SetTypesThrottledUntil(ModelTypeSet types, |
60 base::TimeDelta length, | 60 base::TimeDelta length, |
61 base::TimeTicks now); | 61 base::TimeTicks now); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 128 |
129 size_t num_payloads_per_type_; | 129 size_t num_payloads_per_type_; |
130 | 130 |
131 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); | 131 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); |
132 }; | 132 }; |
133 | 133 |
134 } // namespace sessions | 134 } // namespace sessions |
135 } // namespace syncer | 135 } // namespace syncer |
136 | 136 |
137 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_ | 137 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_ |
OLD | NEW |