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 #include <tr1/memory> | 9 #include <tr1/memory> |
10 #include <string> | 10 #include <string> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 void set_dbus_service(struct UpdateEngineService* dbus_service) { | 80 void set_dbus_service(struct UpdateEngineService* dbus_service) { |
81 dbus_service_ = dbus_service; | 81 dbus_service_ = dbus_service; |
82 } | 82 } |
83 | 83 |
84 // This is the D-Bus service entry point for going through an | 84 // This is the D-Bus service entry point for going through an |
85 // update. If the current status is idle invokes Update. | 85 // update. If the current status is idle invokes Update. |
86 void CheckForUpdate(const std::string& app_version, | 86 void CheckForUpdate(const std::string& app_version, |
87 const std::string& omaha_url); | 87 const std::string& omaha_url); |
88 | 88 |
| 89 // Initiates a reboot if the current state is |
| 90 // UPDATED_NEED_REBOOT. Returns true on sucess, false otherwise. |
| 91 bool RebootIfNeeded(); |
| 92 |
89 // DownloadActionDelegate method | 93 // DownloadActionDelegate method |
90 void BytesReceived(uint64_t bytes_received, uint64_t total); | 94 void BytesReceived(uint64_t bytes_received, uint64_t total); |
91 | 95 |
92 private: | 96 private: |
93 // Sets the status to the given status and notifies a status update | 97 // Sets the status to the given status and notifies a status update |
94 // over dbus. | 98 // over dbus. |
95 void SetStatusAndNotify(UpdateStatus status); | 99 void SetStatusAndNotify(UpdateStatus status); |
96 | 100 |
97 // Creates an error event object in |error_event_| to be included in | 101 // Creates an error event object in |error_event_| to be included in |
98 // an OmahaRequestAction once the current action processor is done. | 102 // an OmahaRequestAction once the current action processor is done. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 135 |
132 // Device paramaters common to all Omaha requests. | 136 // Device paramaters common to all Omaha requests. |
133 OmahaRequestDeviceParams omaha_request_params_; | 137 OmahaRequestDeviceParams omaha_request_params_; |
134 | 138 |
135 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); | 139 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); |
136 }; | 140 }; |
137 | 141 |
138 } // namespace chromeos_update_engine | 142 } // namespace chromeos_update_engine |
139 | 143 |
140 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ | 144 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ |
OLD | NEW |