| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 private: | 116 private: |
| 117 friend class UpdateAttempterTest; | 117 friend class UpdateAttempterTest; |
| 118 FRIEND_TEST(UpdateAttempterTest, ActionCompletedDownloadTest); | 118 FRIEND_TEST(UpdateAttempterTest, ActionCompletedDownloadTest); |
| 119 FRIEND_TEST(UpdateAttempterTest, ActionCompletedErrorTest); | 119 FRIEND_TEST(UpdateAttempterTest, ActionCompletedErrorTest); |
| 120 FRIEND_TEST(UpdateAttempterTest, ActionCompletedOmahaRequestTest); | 120 FRIEND_TEST(UpdateAttempterTest, ActionCompletedOmahaRequestTest); |
| 121 FRIEND_TEST(UpdateAttempterTest, DisableDeltaUpdateIfNeededTest); | 121 FRIEND_TEST(UpdateAttempterTest, DisableDeltaUpdateIfNeededTest); |
| 122 FRIEND_TEST(UpdateAttempterTest, MarkDeltaUpdateFailureTest); | 122 FRIEND_TEST(UpdateAttempterTest, MarkDeltaUpdateFailureTest); |
| 123 FRIEND_TEST(UpdateAttempterTest, ScheduleErrorEventActionNoEventTest); | 123 FRIEND_TEST(UpdateAttempterTest, ScheduleErrorEventActionNoEventTest); |
| 124 FRIEND_TEST(UpdateAttempterTest, ScheduleErrorEventActionTest); | 124 FRIEND_TEST(UpdateAttempterTest, ScheduleErrorEventActionTest); |
| 125 FRIEND_TEST(UpdateAttempterTest, UpdateTest); | 125 FRIEND_TEST(UpdateAttempterTest, UpdateTest); |
| 126 FRIEND_TEST(UpdateAttempterTest, PingOmahaTest); |
| 126 | 127 |
| 127 // Sets the status to the given status and notifies a status update | 128 // Sets the status to the given status and notifies a status update |
| 128 // over dbus. | 129 // over dbus. |
| 129 void SetStatusAndNotify(UpdateStatus status); | 130 void SetStatusAndNotify(UpdateStatus status); |
| 130 | 131 |
| 131 // Sets up the download parameters after receiving the update check response. | 132 // Sets up the download parameters after receiving the update check response. |
| 132 void SetupDownload(); | 133 void SetupDownload(); |
| 133 | 134 |
| 134 // Creates an error event object in |error_event_| to be included in an | 135 // Creates an error event object in |error_event_| to be included in an |
| 135 // OmahaRequestAction once the current action processor is done. | 136 // OmahaRequestAction once the current action processor is done. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // If this was a delta update attempt that failed, count it so that a full | 169 // If this was a delta update attempt that failed, count it so that a full |
| 169 // update can be tried when needed. | 170 // update can be tried when needed. |
| 170 void MarkDeltaUpdateFailure(); | 171 void MarkDeltaUpdateFailure(); |
| 171 | 172 |
| 172 ProxyResolver* GetProxyResolver() { | 173 ProxyResolver* GetProxyResolver() { |
| 173 return obeying_proxies_ ? | 174 return obeying_proxies_ ? |
| 174 reinterpret_cast<ProxyResolver*>(&chrome_proxy_resolver_) : | 175 reinterpret_cast<ProxyResolver*>(&chrome_proxy_resolver_) : |
| 175 reinterpret_cast<ProxyResolver*>(&direct_proxy_resolver_); | 176 reinterpret_cast<ProxyResolver*>(&direct_proxy_resolver_); |
| 176 } | 177 } |
| 177 | 178 |
| 179 // Sends a ping to Omaha. |
| 180 // This is used after an update has been applied and we're waiting for the |
| 181 // user to reboot. This ping helps keep the number of actives count |
| 182 // accurate in case a user takes a long time to reboot the device after an |
| 183 // update has been applied. |
| 184 void PingOmaha(); |
| 185 |
| 178 // Last status notification timestamp used for throttling. Use monotonic | 186 // Last status notification timestamp used for throttling. Use monotonic |
| 179 // TimeTicks to ensure that notifications are sent even if the system clock is | 187 // TimeTicks to ensure that notifications are sent even if the system clock is |
| 180 // set back in the middle of an update. | 188 // set back in the middle of an update. |
| 181 base::TimeTicks last_notify_time_; | 189 base::TimeTicks last_notify_time_; |
| 182 | 190 |
| 183 std::vector<std::tr1::shared_ptr<AbstractAction> > actions_; | 191 std::vector<std::tr1::shared_ptr<AbstractAction> > actions_; |
| 184 scoped_ptr<ActionProcessor> processor_; | 192 scoped_ptr<ActionProcessor> processor_; |
| 185 | 193 |
| 186 // If non-null, this UpdateAttempter will send status updates over this | 194 // If non-null, this UpdateAttempter will send status updates over this |
| 187 // dbus service. | 195 // dbus service. |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 // Our two proxy resolvers | 247 // Our two proxy resolvers |
| 240 DirectProxyResolver direct_proxy_resolver_; | 248 DirectProxyResolver direct_proxy_resolver_; |
| 241 ChromeBrowserProxyResolver chrome_proxy_resolver_; | 249 ChromeBrowserProxyResolver chrome_proxy_resolver_; |
| 242 | 250 |
| 243 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); | 251 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); |
| 244 }; | 252 }; |
| 245 | 253 |
| 246 } // namespace chromeos_update_engine | 254 } // namespace chromeos_update_engine |
| 247 | 255 |
| 248 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ | 256 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ |
| OLD | NEW |