History log of /system/update_engine/mock_proxy_resolver.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3582194c10c47ffcda9ad7881e7fa6eed2404406 05-Feb-2017 Alex Deymo <deymo@google.com> Allow to cancel a proxy resolution request.

After calling GetProxiesForUrl(), there was no way to prevent the
proxy resolver from calling the passed callback once the response is
ready. This implies that the object passed in the callback (normally
as the "data" pointer) must be kept alive until the callback comes
back.

This patch allows to cancel an ongoing request and converts the passed
callback to a base::Callback instead of using a raw pointer.

Bug: 34178297
Test: Added unittests.
Change-Id: Ie544d0230fd0c2dc85c6b9eaca9b5b13702516fa
/system/update_engine/mock_proxy_resolver.h
f28585764e91b7c25a7c2856ff645c8bb22d64a9 25-Feb-2016 Alex Deymo <deymo@google.com> Implement suspend, resume and cancel the download.

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
/system/update_engine/mock_proxy_resolver.h