summaryrefslogtreecommitdiff
path: root/mock_libcurl_http_fetcher.h
AgeCommit message (Collapse)Author
2020-11-03update_engine: Create cros vs. aosp boundary clearAmin Hassani
Its time to make the boundary between Chrome OS and Android code more clear. This CL moves all CrOS only code to "chromeos" directory and the same for Android (in "android" directory). This way we would easily know which code is uses in which project and can keep the code cleaner and more maintainable. One big remaining problem is download_action* files. It seems like DownloadAction class does a lot of things that chrome OS needs and it depends on a lot of Chrome OS stuff, but Android is also using thie Action in a way that circumvent the Chrome OS stuff. For example Android checks for SystemState to be nullptr to not do things. This is really fragile and needs to change. Probably Android Team has to implement their own DownloadAction of some sort and not re use the Chrome OS one in a very fragile way. Removed a few android files that have not been used anywhere. Changed some clang-format and lint issues in order to pass preupload. BUG=b:171829801 TEST=cros_workon_make --board reef --test update_engine Change-Id: I3fff1d4a100a065a5c1484a845241b5521614d9f Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2508965 Tested-by: Amin Hassani <ahassani@chromium.org> Auto-Submit: Amin Hassani <ahassani@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Reviewed-by: Tianjie Xu <xunchang@google.com> Reviewed-by: Kelvin Zhang <zhangkelvin@google.com> Commit-Queue: Amin Hassani <ahassani@chromium.org>
2019-09-11update_engine: Add internal error codes that used for metrics.Amin Hassani
Whenever we are dealing with some problem that require defining error codes and sending UMA metrics, we need to define a new ErrorCode enum value. These error codes then will be used to send which UMA metric value to send. Some of the UMA metrics seems to have circumvent this process by introducing their own error codes without adding them to the global list of error codes. This CL introduces three new error codes: - kInternalLibCurlError - kUnresolvedHostError - kUnresolvedHostRecovered (Technically not an error code, but fits the description and use case of it.) That are then translated to the UMA metric values we send for DownloadErrorCode. In addition, this CL moves the responsibility of sending these UMA metrics from LibCurlHttpFetcher to OmahaRequestAction which is the more correct place to send it because that's where the operations are completed (success or failure) and we can safely decide on the value of UMA without risking to send overlapping or duplicated metrics. For example, previously we send kInternalLibCurlError in conjunction with the kUnresolvedHostError. But doing this can hide the fact that these two error codes might be related and caused by the same underlying issue. Same goes for kUnresolvedHostError and kUnresolvedHosRecovered. If we send both these metrics at the same time, then we need to subtract the number of kUnresolvedHosRecovered from kUnresolvedHostError to figure out the number of unresolved host errors that did not recover. By exclusively sending one or another. We can see exactly how many are recovered and how many did not. Although this might change the meaning of kUnresolvedHostError metric, in the long term it will not be an issue as all the results will converge to the new behavior. The enum.xml (chrome) is updated in crrev.com/c/1774101 BUG=None TEST=cros_workon_make --board=amd64-generic --test --noreconf update_engine Change-Id: I3c7bb5f6159a0bc3a37d55666572b9cd6730f3cb Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/1759544 Reviewed-by: Nicolas Norvez <norvez@chromium.org> Tested-by: Amin Hassani <ahassani@chromium.org> Commit-Queue: Amin Hassani <ahassani@chromium.org>