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 COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ |
8 #define SYNC_SESSIONS_NUDGE_TRACKER_H_ | 8 #define COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 | 11 |
12 #include <list> | 12 #include <list> |
13 #include <map> | 13 #include <map> |
14 #include <memory> | 14 #include <memory> |
15 | 15 |
16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "sync/base/sync_export.h" | 19 #include "components/sync/base/invalidation_interface.h" |
20 #include "sync/internal_api/public/base/invalidation_interface.h" | 20 #include "components/sync/base/model_type.h" |
21 #include "sync/internal_api/public/base/model_type.h" | 21 #include "components/sync/base/sync_export.h" |
22 #include "sync/protocol/sync.pb.h" | 22 #include "components/sync/protocol/sync.pb.h" |
23 #include "sync/sessions/data_type_tracker.h" | 23 #include "components/sync/sessions_impl/data_type_tracker.h" |
24 | 24 |
25 namespace syncer { | 25 namespace syncer { |
26 | 26 |
27 class ObjectIdInvalidationMap; | 27 class ObjectIdInvalidationMap; |
28 | 28 |
29 namespace sessions { | 29 namespace sessions { |
30 | 30 |
31 class SYNC_EXPORT NudgeTracker { | 31 class SYNC_EXPORT NudgeTracker { |
32 public: | 32 public: |
33 static size_t kDefaultMaxPayloadsPerType; | 33 static size_t kDefaultMaxPayloadsPerType; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 // than one reason to perform a particular sync cycle. The GetUpdatesTrigger | 118 // than one reason to perform a particular sync cycle. The GetUpdatesTrigger |
119 // message will contain more reliable information about the reasons for | 119 // message will contain more reliable information about the reasons for |
120 // performing a sync. | 120 // performing a sync. |
121 // | 121 // |
122 // See the implementation for important information about the coalesce logic. | 122 // See the implementation for important information about the coalesce logic. |
123 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource GetLegacySource() const; | 123 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource GetLegacySource() const; |
124 | 124 |
125 // Fills a GetUpdatesTrigger message for the next GetUpdates request. This is | 125 // Fills a GetUpdatesTrigger message for the next GetUpdates request. This is |
126 // used by the DownloadUpdatesCommand to dump lots of useful per-type state | 126 // used by the DownloadUpdatesCommand to dump lots of useful per-type state |
127 // information into the GetUpdate request before sending it off to the server. | 127 // information into the GetUpdate request before sending it off to the server. |
128 void FillProtoMessage( | 128 void FillProtoMessage(ModelType type, sync_pb::GetUpdateTriggers* msg) const; |
129 ModelType type, | |
130 sync_pb::GetUpdateTriggers* msg) const; | |
131 | 129 |
132 // Fills a ProgressMarker with single legacy notification hint expected by the | 130 // Fills a ProgressMarker with single legacy notification hint expected by the |
133 // sync server. Newer servers will rely on the data set by FillProtoMessage() | 131 // sync server. Newer servers will rely on the data set by FillProtoMessage() |
134 // instead of this. | 132 // instead of this. |
135 void SetLegacyNotificationHint( | 133 void SetLegacyNotificationHint( |
136 ModelType type, | 134 ModelType type, |
137 sync_pb::DataTypeProgressMarker* progress) const; | 135 sync_pb::DataTypeProgressMarker* progress) const; |
138 | 136 |
139 // Flips the flag if we're due for a retry. | 137 // Flips the flag if we're due for a retry. |
140 void SetSyncCycleStartTime(base::TimeTicks now); | 138 void SetSyncCycleStartTime(base::TimeTicks now); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 base::TimeDelta minimum_local_nudge_delay_; | 200 base::TimeDelta minimum_local_nudge_delay_; |
203 base::TimeDelta local_refresh_nudge_delay_; | 201 base::TimeDelta local_refresh_nudge_delay_; |
204 base::TimeDelta remote_invalidation_nudge_delay_; | 202 base::TimeDelta remote_invalidation_nudge_delay_; |
205 | 203 |
206 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); | 204 DISALLOW_COPY_AND_ASSIGN(NudgeTracker); |
207 }; | 205 }; |
208 | 206 |
209 } // namespace sessions | 207 } // namespace sessions |
210 } // namespace syncer | 208 } // namespace syncer |
211 | 209 |
212 #endif // SYNC_SESSIONS_NUDGE_TRACKER_H_ | 210 #endif // COMPONENTS_SYNC_SESSIONS_IMPL_NUDGE_TRACKER_H_ |
OLD | NEW |