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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Request that any running syncer task stop as soon as possible and | 72 // Request that any running syncer task stop as soon as possible and |
73 // cancel all scheduled tasks. This function can be called from any thread, | 73 // cancel all scheduled tasks. This function can be called from any thread, |
74 // and should in fact be called from a thread that isn't the sync loop to | 74 // and should in fact be called from a thread that isn't the sync loop to |
75 // allow preempting ongoing sync cycles. | 75 // allow preempting ongoing sync cycles. |
76 // Invokes |callback| from the sync loop once syncer is idle and all tasks | 76 // Invokes |callback| from the sync loop once syncer is idle and all tasks |
77 // are cancelled. | 77 // are cancelled. |
78 void RequestStop(const base::Closure& callback); | 78 void RequestStop(const base::Closure& callback); |
79 | 79 |
80 // The meat and potatoes. | 80 // The meat and potatoes. |
81 void ScheduleNudge(const base::TimeDelta& delay, NudgeSource source, | 81 void ScheduleNudge(const base::TimeDelta& delay, NudgeSource source, |
82 syncable::ModelEnumSet types, | 82 syncable::ModelTypeSet types, |
83 const tracked_objects::Location& nudge_location); | 83 const tracked_objects::Location& nudge_location); |
84 void ScheduleNudgeWithPayloads( | 84 void ScheduleNudgeWithPayloads( |
85 const base::TimeDelta& delay, NudgeSource source, | 85 const base::TimeDelta& delay, NudgeSource source, |
86 const syncable::ModelTypePayloadMap& types_with_payloads, | 86 const syncable::ModelTypePayloadMap& types_with_payloads, |
87 const tracked_objects::Location& nudge_location); | 87 const tracked_objects::Location& nudge_location); |
88 | 88 |
89 // Note: The source argument of this function must come from the subset of | 89 // Note: The source argument of this function must come from the subset of |
90 // GetUpdatesCallerInfo values related to configurations. | 90 // GetUpdatesCallerInfo values related to configurations. |
91 void ScheduleConfig( | 91 void ScheduleConfig( |
92 syncable::ModelEnumSet types, | 92 syncable::ModelTypeSet types, |
93 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source); | 93 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source); |
94 | 94 |
95 void ScheduleClearUserData(); | 95 void ScheduleClearUserData(); |
96 // If this is called before Start(), the cleanup is guaranteed to | 96 // If this is called before Start(), the cleanup is guaranteed to |
97 // happen before the Start finishes. | 97 // happen before the Start finishes. |
98 // | 98 // |
99 // TODO(akalin): Figure out how to test this. | 99 // TODO(akalin): Figure out how to test this. |
100 void ScheduleCleanupDisabledTypes(); | 100 void ScheduleCleanupDisabledTypes(); |
101 | 101 |
102 // Change status of notifications in the SyncSessionContext. | 102 // Change status of notifications in the SyncSessionContext. |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 scoped_ptr<Syncer> syncer_; | 410 scoped_ptr<Syncer> syncer_; |
411 | 411 |
412 scoped_ptr<sessions::SyncSessionContext> session_context_; | 412 scoped_ptr<sessions::SyncSessionContext> session_context_; |
413 | 413 |
414 DISALLOW_COPY_AND_ASSIGN(SyncScheduler); | 414 DISALLOW_COPY_AND_ASSIGN(SyncScheduler); |
415 }; | 415 }; |
416 | 416 |
417 } // namespace browser_sync | 417 } // namespace browser_sync |
418 | 418 |
419 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ | 419 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNC_SCHEDULER_H_ |
OLD | NEW |