OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ |
7 | 7 |
8 #include <time.h> | 8 #include <time.h> |
9 | 9 |
10 #include <tr1/memory> | 10 #include <tr1/memory> |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // OmahaRequestAction with that event in the current processor, clears the | 127 // OmahaRequestAction with that event in the current processor, clears the |
128 // pending event, updates the status and returns true. Returns false | 128 // pending event, updates the status and returns true. Returns false |
129 // otherwise. | 129 // otherwise. |
130 bool ScheduleErrorEventAction(); | 130 bool ScheduleErrorEventAction(); |
131 | 131 |
132 // Sets the process priority to |priority| and updates |priority_| if the new | 132 // Sets the process priority to |priority| and updates |priority_| if the new |
133 // |priority| is different than the current |priority_|, otherwise simply | 133 // |priority| is different than the current |priority_|, otherwise simply |
134 // returns. | 134 // returns. |
135 void SetPriority(utils::ProcessPriority priority); | 135 void SetPriority(utils::ProcessPriority priority); |
136 | 136 |
137 // Set the process priority to low and sets up timeout events to increase the | 137 // Sets the process priority to low and sets up timeout events to increase it. |
138 // priority gradually to high. | |
139 void SetupPriorityManagement(); | 138 void SetupPriorityManagement(); |
140 | 139 |
141 // Resets the process priority to normal and destroys any scheduled timeout | 140 // Resets the process priority to normal and destroys any scheduled timeout |
142 // sources. | 141 // sources. |
143 void CleanupPriorityManagement(); | 142 void CleanupPriorityManagement(); |
144 | 143 |
145 // The process priority timeout source callback increases the current priority | 144 // The process priority timeout source callback sets the current priority to |
146 // by one step (low goes to normal, normal goes to high). Returns true if the | 145 // normal. Returns false so that GLib destroys the timeout source. |
147 // callback must be invoked again after a timeout, or false if GLib can | |
148 // destroy this timeout source. | |
149 static gboolean StaticManagePriorityCallback(gpointer data); | 146 static gboolean StaticManagePriorityCallback(gpointer data); |
150 bool ManagePriorityCallback(); | 147 bool ManagePriorityCallback(); |
151 | 148 |
152 // Checks if a full update is needed and forces it by updating the Omaha | 149 // Checks if a full update is needed and forces it by updating the Omaha |
153 // request params. | 150 // request params. |
154 void DisableDeltaUpdateIfNeeded(); | 151 void DisableDeltaUpdateIfNeeded(); |
155 | 152 |
156 // If this was a delta update attempt that failed, count it so that a full | 153 // If this was a delta update attempt that failed, count it so that a full |
157 // update can be tried when needed. | 154 // update can be tried when needed. |
158 void MarkDeltaUpdateFailure(); | 155 void MarkDeltaUpdateFailure(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 | 207 |
211 // Device paramaters common to all Omaha requests. | 208 // Device paramaters common to all Omaha requests. |
212 OmahaRequestDeviceParams omaha_request_params_; | 209 OmahaRequestDeviceParams omaha_request_params_; |
213 | 210 |
214 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); | 211 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); |
215 }; | 212 }; |
216 | 213 |
217 } // namespace chromeos_update_engine | 214 } // namespace chromeos_update_engine |
218 | 215 |
219 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ | 216 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ |
OLD | NEW |