OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // A class to schedule syncer tasks intelligently. | 5 // A class to schedule syncer tasks intelligently. |
6 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_H_ | 6 #ifndef SYNC_ENGINE_SYNC_SCHEDULER_H_ |
7 #define SYNC_ENGINE_SYNC_SCHEDULER_H_ | 7 #define SYNC_ENGINE_SYNC_SCHEDULER_H_ |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/time.h" | 13 #include "base/time.h" |
14 #include "sync/engine/nudge_source.h" | 14 #include "sync/engine/nudge_source.h" |
15 #include "sync/internal_api/public/base/model_type_state_map.h" | 15 #include "sync/internal_api/public/base/model_type_invalidation_map.h" |
16 #include "sync/sessions/sync_session.h" | 16 #include "sync/sessions/sync_session.h" |
17 | 17 |
18 class MessageLoop; | 18 class MessageLoop; |
19 | 19 |
20 namespace tracked_objects { | 20 namespace tracked_objects { |
21 class Location; | 21 class Location; |
22 } // namespace tracked_objects | 22 } // namespace tracked_objects |
23 | 23 |
24 namespace syncer { | 24 namespace syncer { |
25 | 25 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 // The meat and potatoes. Both of these methods will post a delayed task | 86 // The meat and potatoes. Both of these methods will post a delayed task |
87 // to attempt the actual nudge (see ScheduleNudgeImpl). | 87 // to attempt the actual nudge (see ScheduleNudgeImpl). |
88 virtual void ScheduleNudgeAsync( | 88 virtual void ScheduleNudgeAsync( |
89 const base::TimeDelta& delay, | 89 const base::TimeDelta& delay, |
90 NudgeSource source, | 90 NudgeSource source, |
91 ModelTypeSet types, | 91 ModelTypeSet types, |
92 const tracked_objects::Location& nudge_location) = 0; | 92 const tracked_objects::Location& nudge_location) = 0; |
93 virtual void ScheduleNudgeWithStatesAsync( | 93 virtual void ScheduleNudgeWithStatesAsync( |
94 const base::TimeDelta& delay, NudgeSource source, | 94 const base::TimeDelta& delay, NudgeSource source, |
95 const ModelTypeStateMap& type_state_map, | 95 const ModelTypeInvalidationMap& invalidation_map, |
96 const tracked_objects::Location& nudge_location) = 0; | 96 const tracked_objects::Location& nudge_location) = 0; |
97 | 97 |
98 // Change status of notifications in the SyncSessionContext. | 98 // Change status of notifications in the SyncSessionContext. |
99 virtual void SetNotificationsEnabled(bool notifications_enabled) = 0; | 99 virtual void SetNotificationsEnabled(bool notifications_enabled) = 0; |
100 | 100 |
101 virtual base::TimeDelta GetSessionsCommitDelay() const = 0; | 101 virtual base::TimeDelta GetSessionsCommitDelay() const = 0; |
102 | 102 |
103 // Called when credentials are updated by the user. | 103 // Called when credentials are updated by the user. |
104 virtual void OnCredentialsUpdated() = 0; | 104 virtual void OnCredentialsUpdated() = 0; |
105 | 105 |
106 // Called when the network layer detects a connection status change. | 106 // Called when the network layer detects a connection status change. |
107 virtual void OnConnectionStatusChange() = 0; | 107 virtual void OnConnectionStatusChange() = 0; |
108 }; | 108 }; |
109 | 109 |
110 } // namespace syncer | 110 } // namespace syncer |
111 | 111 |
112 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ | 112 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ |
OLD | NEW |