summaryrefslogtreecommitdiff
path: root/common/action_processor.h
AgeCommit message (Collapse)Author
2020-07-31Add unit test for fallback route of manifest cacheKelvin Zhang
Test: Run atest Change-Id: Icc6a2c809c571c3ad8e16a863c37afd8d4042ed6
2019-01-16update_engine: Run clang-format on common/Amin Hassani
BUG=none TEST=unittest Change-Id: Icdaf5017e03a197bc576f08f4b8dcdd00cff217c Reviewed-on: https://chromium-review.googlesource.com/1407541 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Sen Jiang <senj@chromium.org>
2018-10-13Uprev libchrome to r576279 (1/multiple)Jakub Pawlowski
* StatisticsRecorder no longer need call to Initialize() * tracked_objects::Location -> base::Location * base::*ToString replaced with base::NumberToString Test: compilation Change-Id: I5f912bd15f7cb26df3edc1ad7f4479122ffb6d7a Merged-In: I5f912bd15f7cb26df3edc1ad7f4479122ffb6d7a
2018-07-25update_engine: Pass Action ownership to ActionProcessorAmin Hassani
Currently, an object that uses an ActionProcessor for processing one or more actions has to own the Actions. This is problematic, because if we want to create an action on the fly and use an ActionProcessor to perform it, we have to own the Action until it is finished. Furthermore, if someone forget to own the action, there will be memory leaks because ActionProcessor does not delete the Action. This patch passes the ownership of the Actions to the ActionProcessor through unique pointers. If an object wants to have access to the Action, it can get it when ActionComplete() is called. BUG=chromium:807976 TEST=unittests TEST=cros flash TEST=precq Change-Id: I28f7e9fd3425f17cc51b4db4a4abc130a7d6ef8f Reviewed-on: https://chromium-review.googlesource.com/1065113 Commit-Ready: Amin Hassani <ahassani@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Reviewed-by: Xiaochu Liu <xiaochu@chromium.org>
2016-03-04Implement suspend, resume and cancel the download.Alex Deymo
The DownloadAction can now be suspended and resumed, using the existing libcurl hooks to pause the download. For canceling an ongoing update, this patch leverages the existing StopProcessing method previously used in unittest only with a slight change: Stopping the ActionProcessor also removes all the pending actions. The LibcurlHttpFetcher Pause/Unpause methods where improved to support (not crash) if paused in circumstances where there isn't a current connection, like when waiting for the proxy resolver and when trying to reconnect. Finally, the value of ongoing_update_ is now properly set in the UpdateAttempter. Bug: 27047026 TEST=Tested suspending, resuming and canceling the update on a device. TEST=Added unittest for the Pause/Unpause logic. Change-Id: I0df1e1a8cf70a3b736bc9cd4899d37813f381b94
2016-02-29Allow to Suspend/Resume the ActionProcessor.Alex Deymo
This patch implements the core functionality of suspend/resume actions from the ActionProcessor. No actions support suspend/resume yet. Bug: 27047026 TEST=Added unittets, tested on edison-eng. Change-Id: Ib9600098dbccf05fc30f10f0add4a5bc87892b66
2015-11-12Split payload application code into a subdirectory.Alex Deymo
This patch splits from the main libupdate_engine code the part that is strictly used to download and apply a payload into a new static library, moving the code to subdirectories. The new library is divided in two subdirectories: common/ and payload_consumer/, and should not depend on other update_engine files outside those two subdirectories. The main difference between those two is that the common/ tools are more generic and not tied to the payload consumer process, but otherwise they are both compiled together. There are still dependencies from the new libpayload_consumer library into the main directory files and DBus generated files. Those will be addressed in follow up CLs. Bug: 25197634 Test: FEATURES=test emerge-link update_engine; `mm` on Brillo. Change-Id: Id8d0204ea573627e6e26ca9ea17b9592ca95bc23