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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // DownloadActionDelegate method | 83 // DownloadActionDelegate method |
84 void BytesReceived(uint64_t bytes_received, uint64_t total); | 84 void BytesReceived(uint64_t bytes_received, uint64_t total); |
85 | 85 |
86 private: | 86 private: |
87 // Sets the status to the given status and notifies a status update | 87 // Sets the status to the given status and notifies a status update |
88 // over dbus. | 88 // over dbus. |
89 void SetStatusAndNotify(UpdateStatus status); | 89 void SetStatusAndNotify(UpdateStatus status); |
90 | 90 |
91 // Creates an error event object in |error_event_| to be included in | 91 // Creates an error event object in |error_event_| to be included in |
92 // an OmahaRequestAction once the current action processor is done. | 92 // an OmahaRequestAction once the current action processor is done. |
93 void CreatePendingErrorEvent(ActionExitCode code); | 93 void CreatePendingErrorEvent(AbstractAction* action, ActionExitCode code); |
94 | 94 |
95 // If there's a pending error event allocated in |error_event_|, | 95 // If there's a pending error event allocated in |error_event_|, |
96 // schedules an OmahaRequestAction with that event in the current | 96 // schedules an OmahaRequestAction with that event in the current |
97 // processor, clears the pending event, updates the status and | 97 // processor, clears the pending event, updates the status and |
98 // returns true. Returns false otherwise. | 98 // returns true. Returns false otherwise. |
99 bool ScheduleErrorEventAction(); | 99 bool ScheduleErrorEventAction(); |
100 | 100 |
101 struct timespec last_notify_time_; | 101 struct timespec last_notify_time_; |
102 | 102 |
103 std::vector<std::tr1::shared_ptr<AbstractAction> > actions_; | 103 std::vector<std::tr1::shared_ptr<AbstractAction> > actions_; |
(...skipping 21 matching lines...) Expand all Loading... |
125 | 125 |
126 // Device paramaters common to all Omaha requests. | 126 // Device paramaters common to all Omaha requests. |
127 OmahaRequestDeviceParams omaha_request_params_; | 127 OmahaRequestDeviceParams omaha_request_params_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); | 129 DISALLOW_COPY_AND_ASSIGN(UpdateAttempter); |
130 }; | 130 }; |
131 | 131 |
132 } // namespace chromeos_update_engine | 132 } // namespace chromeos_update_engine |
133 | 133 |
134 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ | 134 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_UPDATE_ATTEMPTER_H__ |
OLD | NEW |