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