OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ | 5 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ |
6 #define SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ | 6 #define SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 BackoffDelayProvider* delay_provider, | 48 BackoffDelayProvider* delay_provider, |
49 sessions::SyncSessionContext* context, | 49 sessions::SyncSessionContext* context, |
50 Syncer* syncer); | 50 Syncer* syncer); |
51 | 51 |
52 // Calls Stop(). | 52 // Calls Stop(). |
53 virtual ~SyncSchedulerImpl(); | 53 virtual ~SyncSchedulerImpl(); |
54 | 54 |
55 virtual void Start(Mode mode) OVERRIDE; | 55 virtual void Start(Mode mode) OVERRIDE; |
56 virtual bool ScheduleConfiguration( | 56 virtual bool ScheduleConfiguration( |
57 const ConfigurationParams& params) OVERRIDE; | 57 const ConfigurationParams& params) OVERRIDE; |
58 virtual void RequestStop() OVERRIDE; | 58 virtual void Stop() OVERRIDE; |
59 virtual void ScheduleLocalNudge( | 59 virtual void ScheduleLocalNudge( |
60 const base::TimeDelta& desired_delay, | 60 const base::TimeDelta& desired_delay, |
61 ModelTypeSet types, | 61 ModelTypeSet types, |
62 const tracked_objects::Location& nudge_location) OVERRIDE; | 62 const tracked_objects::Location& nudge_location) OVERRIDE; |
63 virtual void ScheduleLocalRefreshRequest( | 63 virtual void ScheduleLocalRefreshRequest( |
64 const base::TimeDelta& desired_delay, | 64 const base::TimeDelta& desired_delay, |
65 ModelTypeSet types, | 65 ModelTypeSet types, |
66 const tracked_objects::Location& nudge_location) OVERRIDE; | 66 const tracked_objects::Location& nudge_location) OVERRIDE; |
67 virtual void ScheduleInvalidationNudge( | 67 virtual void ScheduleInvalidationNudge( |
68 const base::TimeDelta& desired_delay, | 68 const base::TimeDelta& desired_delay, |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 // Helper to restart waiting with |wait_interval_|'s timer. | 176 // Helper to restart waiting with |wait_interval_|'s timer. |
177 void RestartWaiting(); | 177 void RestartWaiting(); |
178 | 178 |
179 // Determines if we're allowed to contact the server right now. | 179 // Determines if we're allowed to contact the server right now. |
180 bool CanRunJobNow(JobPriority priority); | 180 bool CanRunJobNow(JobPriority priority); |
181 | 181 |
182 // Determines if we're allowed to contact the server right now. | 182 // Determines if we're allowed to contact the server right now. |
183 bool CanRunNudgeJobNow(JobPriority priority); | 183 bool CanRunNudgeJobNow(JobPriority priority); |
184 | 184 |
185 // 'Impl' here refers to real implementation of public functions. | |
186 void StopImpl(); | |
187 | |
188 // If the scheduler's current state supports it, this will create a job based | 185 // If the scheduler's current state supports it, this will create a job based |
189 // on the passed in parameters and coalesce it with any other pending jobs, | 186 // on the passed in parameters and coalesce it with any other pending jobs, |
190 // then post a delayed task to run it. It may also choose to drop the job or | 187 // then post a delayed task to run it. It may also choose to drop the job or |
191 // save it for later, depending on the scheduler's current state. | 188 // save it for later, depending on the scheduler's current state. |
192 void ScheduleNudgeImpl( | 189 void ScheduleNudgeImpl( |
193 const base::TimeDelta& delay, | 190 const base::TimeDelta& delay, |
194 const tracked_objects::Location& nudge_location); | 191 const tracked_objects::Location& nudge_location); |
195 | 192 |
196 // Returns true if the client is currently in exponential backoff. | 193 // Returns true if the client is currently in exponential backoff. |
197 bool IsBackingOff() const; | 194 bool IsBackingOff() const; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 // The change is to remember that poll timer just fired and retry poll job | 316 // The change is to remember that poll timer just fired and retry poll job |
320 // after credentials are updated. | 317 // after credentials are updated. |
321 bool do_poll_after_credentials_updated_; | 318 bool do_poll_after_credentials_updated_; |
322 | 319 |
323 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); | 320 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); |
324 }; | 321 }; |
325 | 322 |
326 } // namespace syncer | 323 } // namespace syncer |
327 | 324 |
328 #endif // SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ | 325 #endif // SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ |
OLD | NEW |