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> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include <glib.h> | 14 #include <glib.h> |
15 | 15 |
| 16 #include "base/time.h" |
16 #include "update_engine/action_processor.h" | 17 #include "update_engine/action_processor.h" |
17 #include "update_engine/download_action.h" | 18 #include "update_engine/download_action.h" |
18 #include "update_engine/omaha_request_params.h" | 19 #include "update_engine/omaha_request_params.h" |
19 #include "update_engine/omaha_response_handler_action.h" | 20 #include "update_engine/omaha_response_handler_action.h" |
20 | 21 |
21 class MetricsLibraryInterface; | 22 class MetricsLibraryInterface; |
22 struct UpdateEngineService; | 23 struct UpdateEngineService; |
23 | 24 |
24 namespace chromeos_update_engine { | 25 namespace chromeos_update_engine { |
25 | 26 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // timeout sources. | 120 // timeout sources. |
120 void CleanupPriorityManagement(); | 121 void CleanupPriorityManagement(); |
121 | 122 |
122 // The process priority timeout source callback increases the | 123 // The process priority timeout source callback increases the |
123 // current priority by one step (low goes to normal, normal goes to | 124 // current priority by one step (low goes to normal, normal goes to |
124 // high). Returns true if the callback must be invoked again after a | 125 // high). Returns true if the callback must be invoked again after a |
125 // timeout, or false if GLib can destroy this timeout source. | 126 // timeout, or false if GLib can destroy this timeout source. |
126 static gboolean StaticManagePriorityCallback(gpointer data); | 127 static gboolean StaticManagePriorityCallback(gpointer data); |
127 bool ManagePriorityCallback(); | 128 bool ManagePriorityCallback(); |
128 | 129 |
129 struct timespec last_notify_time_; | 130 // Last status notification timestamp used for throttling. Use |
| 131 // monotonic TimeTicks to ensure that notifications are sent even if |
| 132 // the system clock is set back in the middle of an update. |
| 133 base::TimeTicks last_notify_time_; |
130 | 134 |
131 std::vector<std::tr1::shared_ptr<AbstractAction> > actions_; | 135 std::vector<std::tr1::shared_ptr<AbstractAction> > actions_; |
132 ActionProcessor processor_; | 136 ActionProcessor processor_; |
133 | 137 |
134 // If non-null, this UpdateAttempter will send status updates over this | 138 // If non-null, this UpdateAttempter will send status updates over this |
135 // dbus service. | 139 // dbus service. |
136 UpdateEngineService* dbus_service_; | 140 UpdateEngineService* dbus_service_; |
137 | 141 |
138 // pointer to the OmahaResponseHandlerAction in the actions_ vector; | 142 // pointer to the OmahaResponseHandlerAction in the actions_ vector; |
139 std::tr1::shared_ptr<OmahaResponseHandlerAction> response_handler_action_; | 143 std::tr1::shared_ptr<OmahaResponseHandlerAction> response_handler_action_; |
(...skipping 26 matching lines...) Expand all Loading... |
166 | 170 |
167 // Device paramaters common to all Omaha requests. | 171 // Device paramaters common to all Omaha requests. |
168 OmahaRequestDeviceParams omaha_request_params_; | 172 OmahaRequestDeviceParams omaha_request_params_; |
169 | 173 |
170 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); | 174 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); |
171 }; | 175 }; |
172 | 176 |
173 } // namespace chromeos_update_engine | 177 } // namespace chromeos_update_engine |
174 | 178 |
175 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ | 179 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ |
OLD | NEW |