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.
(cherry picked from commit 3582194c10c47ffcda9ad7881e7fa6eed2404406)
Bug: 34178297
Test: Added unittests.
Change-Id: Ie544d0230fd0c2dc85c6b9eaca9b5b13702516fa
Reviewed-on: https://chromium-review.googlesource.com/497490
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/Android.mk b/Android.mk
index ca8087c..0da1b90 100644
--- a/Android.mk
+++ b/Android.mk
@@ -936,6 +936,7 @@
payload_generator/topological_sort_unittest.cc \
payload_generator/zip_unittest.cc \
payload_state_unittest.cc \
+ proxy_resolver_unittest.cc \
update_attempter_unittest.cc \
update_manager/boxed_value_unittest.cc \
update_manager/chromeos_policy_unittest.cc \