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 // 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/time.h" | 13 #include "base/time/time.h" |
14 #include "sync/base/sync_export.h" | 14 #include "sync/base/sync_export.h" |
15 #include "sync/engine/nudge_source.h" | 15 #include "sync/engine/nudge_source.h" |
16 #include "sync/internal_api/public/base/model_type_invalidation_map.h" | 16 #include "sync/notifier/object_id_invalidation_map.h" |
17 #include "sync/sessions/sync_session.h" | 17 #include "sync/sessions/sync_session.h" |
18 | 18 |
19 namespace tracked_objects { | 19 namespace tracked_objects { |
20 class Location; | 20 class Location; |
21 } // namespace tracked_objects | 21 } // namespace tracked_objects |
22 | 22 |
23 namespace syncer { | 23 namespace syncer { |
24 | 24 |
25 struct ServerConnectionEvent; | 25 struct ServerConnectionEvent; |
26 | 26 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const base::TimeDelta& desired_delay, | 105 const base::TimeDelta& desired_delay, |
106 ModelTypeSet types, | 106 ModelTypeSet types, |
107 const tracked_objects::Location& nudge_location) = 0; | 107 const tracked_objects::Location& nudge_location) = 0; |
108 | 108 |
109 // Invalidations are notifications the server sends to let us know when other | 109 // Invalidations are notifications the server sends to let us know when other |
110 // clients have committed data. We need to contact the sync server (being | 110 // clients have committed data. We need to contact the sync server (being |
111 // careful to pass along the "hints" delivered with those invalidations) in | 111 // careful to pass along the "hints" delivered with those invalidations) in |
112 // order to fetch the update. | 112 // order to fetch the update. |
113 virtual void ScheduleInvalidationNudge( | 113 virtual void ScheduleInvalidationNudge( |
114 const base::TimeDelta& desired_delay, | 114 const base::TimeDelta& desired_delay, |
115 const ModelTypeInvalidationMap& invalidation_map, | 115 const ObjectIdInvalidationMap& invalidations, |
116 const tracked_objects::Location& nudge_location) = 0; | 116 const tracked_objects::Location& nudge_location) = 0; |
117 | 117 |
118 // Change status of notifications in the SyncSessionContext. | 118 // Change status of notifications in the SyncSessionContext. |
119 virtual void SetNotificationsEnabled(bool notifications_enabled) = 0; | 119 virtual void SetNotificationsEnabled(bool notifications_enabled) = 0; |
120 | 120 |
121 virtual base::TimeDelta GetSessionsCommitDelay() const = 0; | 121 virtual base::TimeDelta GetSessionsCommitDelay() const = 0; |
122 | 122 |
123 // Called when credentials are updated by the user. | 123 // Called when credentials are updated by the user. |
124 virtual void OnCredentialsUpdated() = 0; | 124 virtual void OnCredentialsUpdated() = 0; |
125 | 125 |
126 // Called when the network layer detects a connection status change. | 126 // Called when the network layer detects a connection status change. |
127 virtual void OnConnectionStatusChange() = 0; | 127 virtual void OnConnectionStatusChange() = 0; |
128 }; | 128 }; |
129 | 129 |
130 } // namespace syncer | 130 } // namespace syncer |
131 | 131 |
132 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ | 132 #endif // SYNC_ENGINE_SYNC_SCHEDULER_H_ |
OLD | NEW |