OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 schedule syncer tasks intelligently. | 5 // A class to schedule syncer tasks intelligently. |
6 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ | 6 #ifndef CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ |
7 #define CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ | 7 #define CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ |
8 #pragma once | 8 #pragma once |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // the task in between calls to Start/Stop. | 248 // the task in between calls to Start/Stop. |
249 void PostTask(const tracked_objects::Location& from_here, | 249 void PostTask(const tracked_objects::Location& from_here, |
250 const char* name, | 250 const char* name, |
251 const base::Closure& task); | 251 const base::Closure& task); |
252 void PostDelayedTask(const tracked_objects::Location& from_here, | 252 void PostDelayedTask(const tracked_objects::Location& from_here, |
253 const char* name, | 253 const char* name, |
254 const base::Closure& task, | 254 const base::Closure& task, |
255 int64 delay_ms); | 255 int64 delay_ms); |
256 | 256 |
257 // Helper to assemble a job and post a delayed task to sync. | 257 // Helper to assemble a job and post a delayed task to sync. |
258 void ScheduleSyncSessionJob( | 258 void ScheduleSyncSessionJob(const SyncSessionJob& job); |
259 const base::TimeDelta& delay, | |
260 SyncSessionJob::SyncSessionJobPurpose purpose, | |
261 sessions::SyncSession* session, | |
262 const tracked_objects::Location& from_here); | |
263 | 259 |
264 // Invoke the Syncer to perform a sync. | 260 // Invoke the Syncer to perform a sync. |
265 void DoSyncSessionJob(const SyncSessionJob& job); | 261 void DoSyncSessionJob(const SyncSessionJob& job); |
266 | 262 |
267 // Called after the Syncer has performed the sync represented by |job|, to | 263 // Called after the Syncer has performed the sync represented by |job|, to |
268 // reset our state. | 264 // reset our state. |
269 void FinishSyncSessionJob(const SyncSessionJob& job); | 265 void FinishSyncSessionJob(const SyncSessionJob& job); |
270 | 266 |
271 // Record important state that might be needed in future syncs, such as which | 267 // Record important state that might be needed in future syncs, such as which |
272 // data types may require cleanup. | 268 // data types may require cleanup. |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 scoped_ptr<Syncer> syncer_; | 406 scoped_ptr<Syncer> syncer_; |
411 | 407 |
412 scoped_ptr<sessions::SyncSessionContext> session_context_; | 408 scoped_ptr<sessions::SyncSessionContext> session_context_; |
413 | 409 |
414 DISALLOW_COPY_AND_ASSIGN(SyncScheduler); | 410 DISALLOW_COPY_AND_ASSIGN(SyncScheduler); |
415 }; | 411 }; |
416 | 412 |
417 } // namespace browser_sync | 413 } // namespace browser_sync |
418 | 414 |
419 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ | 415 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ |
OLD | NEW |