| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // the task in between calls to Start/Stop. | 161 // the task in between calls to Start/Stop. |
| 162 void PostTask(const tracked_objects::Location& from_here, | 162 void PostTask(const tracked_objects::Location& from_here, |
| 163 const char* name, | 163 const char* name, |
| 164 const base::Closure& task); | 164 const base::Closure& task); |
| 165 void PostDelayedTask(const tracked_objects::Location& from_here, | 165 void PostDelayedTask(const tracked_objects::Location& from_here, |
| 166 const char* name, | 166 const char* name, |
| 167 const base::Closure& task, | 167 const base::Closure& task, |
| 168 base::TimeDelta delay); | 168 base::TimeDelta delay); |
| 169 | 169 |
| 170 // Helper to assemble a job and post a delayed task to sync. | 170 // Helper to assemble a job and post a delayed task to sync. |
| 171 void ScheduleSyncSessionJob(scoped_ptr<SyncSessionJob> job); | 171 void ScheduleSyncSessionJob(const tracked_objects::Location& loc, |
| 172 scoped_ptr<SyncSessionJob> job); |
| 172 | 173 |
| 173 // Invoke the Syncer to perform a sync. | 174 // Invoke the Syncer to perform a sync. |
| 174 bool DoSyncSessionJob(scoped_ptr<SyncSessionJob> job); | 175 bool DoSyncSessionJob(scoped_ptr<SyncSessionJob> job); |
| 175 | 176 |
| 176 // Called after the Syncer has performed the sync represented by |job|, to | 177 // Called after the Syncer has performed the sync represented by |job|, to |
| 177 // reset our state. |exited_prematurely| is true if the Syncer did not | 178 // reset our state. |exited_prematurely| is true if the Syncer did not |
| 178 // cycle from job.start_step() to job.end_step(), likely because the | 179 // cycle from job.start_step() to job.end_step(), likely because the |
| 179 // scheduler was forced to quit the job mid-way through. | 180 // scheduler was forced to quit the job mid-way through. |
| 180 bool FinishSyncSessionJob(scoped_ptr<SyncSessionJob> job, | 181 bool FinishSyncSessionJob(scoped_ptr<SyncSessionJob> job, |
| 181 bool exited_prematurely); | 182 bool exited_prematurely); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 // take place during a sync cycle. We call this out because such violations | 340 // take place during a sync cycle. We call this out because such violations |
| 340 // could result in tight sync loops hitting sync servers. | 341 // could result in tight sync loops hitting sync servers. |
| 341 bool no_scheduling_allowed_; | 342 bool no_scheduling_allowed_; |
| 342 | 343 |
| 343 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); | 344 DISALLOW_COPY_AND_ASSIGN(SyncSchedulerImpl); |
| 344 }; | 345 }; |
| 345 | 346 |
| 346 } // namespace syncer | 347 } // namespace syncer |
| 347 | 348 |
| 348 #endif // SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ | 349 #endif // SYNC_ENGINE_SYNC_SCHEDULER_IMPL_H_ |
| OLD | NEW |