| 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 COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 class BackoffDelayProvider; | 33 class BackoffDelayProvider; |
| 34 struct ModelNeutralState; | 34 struct ModelNeutralState; |
| 35 | 35 |
| 36 class SyncSchedulerImpl : public SyncScheduler, public base::NonThreadSafe { | 36 class SyncSchedulerImpl : public SyncScheduler, public base::NonThreadSafe { |
| 37 public: | 37 public: |
| 38 // |name| is a display string to identify the syncer thread. Takes | 38 // |name| is a display string to identify the syncer thread. Takes |
| 39 // |ownership of |syncer| and |delay_provider|. | 39 // |ownership of |syncer| and |delay_provider|. |
| 40 SyncSchedulerImpl(const std::string& name, | 40 SyncSchedulerImpl(const std::string& name, |
| 41 BackoffDelayProvider* delay_provider, | 41 BackoffDelayProvider* delay_provider, |
| 42 SyncCycleContext* context, | 42 SyncCycleContext* context, |
| 43 Syncer* syncer); | 43 Syncer* syncer, |
| 44 bool ignore_auth_credentials); |
| 44 | 45 |
| 45 // Calls Stop(). | 46 // Calls Stop(). |
| 46 ~SyncSchedulerImpl() override; | 47 ~SyncSchedulerImpl() override; |
| 47 | 48 |
| 48 void Start(Mode mode, base::Time last_poll_time) override; | 49 void Start(Mode mode, base::Time last_poll_time) override; |
| 49 void ScheduleConfiguration(const ConfigurationParams& params) override; | 50 void ScheduleConfiguration(const ConfigurationParams& params) override; |
| 50 void ScheduleClearServerData(const ClearParams& params) override; | 51 void ScheduleClearServerData(const ClearParams& params) override; |
| 51 void Stop() override; | 52 void Stop() override; |
| 52 void ScheduleLocalNudge( | 53 void ScheduleLocalNudge( |
| 53 ModelTypeSet types, | 54 ModelTypeSet types, |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // time TrySyncCycleJobImpl is called. CANARY_PRIORITY allows syncer to run | 285 // time TrySyncCycleJobImpl is called. CANARY_PRIORITY allows syncer to run |
| 285 // even if scheduler is in exponential backoff. This is needed for events that | 286 // even if scheduler is in exponential backoff. This is needed for events that |
| 286 // have chance of resolving previous error (e.g. network connection change | 287 // have chance of resolving previous error (e.g. network connection change |
| 287 // after NETWORK_UNAVAILABLE error). | 288 // after NETWORK_UNAVAILABLE error). |
| 288 // It is reset back to NORMAL_PRIORITY on every call to TrySyncCycleJobImpl. | 289 // It is reset back to NORMAL_PRIORITY on every call to TrySyncCycleJobImpl. |
| 289 JobPriority next_sync_cycle_job_priority_; | 290 JobPriority next_sync_cycle_job_priority_; |
| 290 | 291 |
| 291 // One-shot timer for scheduling GU retry according to delay set by server. | 292 // One-shot timer for scheduling GU retry according to delay set by server. |
| 292 base::OneShotTimer retry_timer_; | 293 base::OneShotTimer retry_timer_; |
| 293 | 294 |
| 295 // Dictates if the scheduler should wait for authentication to happen or not. |
| 296 bool ignore_auth_credentials_; |
| 297 |
| 294 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_; | 298 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_; |
| 295 | 299 |
| 296 // A second factory specially for weak_handle_this_, to allow the handle | 300 // A second factory specially for weak_handle_this_, to allow the handle |
| 297 // to be const and alleviate threading concerns. | 301 // to be const and alleviate threading concerns. |
| 298 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_; | 302 base::WeakPtrFactory<SyncSchedulerImpl> weak_ptr_factory_for_weak_handle_; |
| 299 | 303 |
| 300 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); | 304 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); |
| 301 }; | 305 }; |
| 302 | 306 |
| 303 } // namespace syncer | 307 } // namespace syncer |
| 304 | 308 |
| 305 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ | 309 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNC_SCHEDULER_IMPL_H_ |
| OLD | NEW |