diff options
author | Jeffrey Kardatzke <jkardatzke@google.com> | 2017-10-02 16:08:44 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-09 20:07:57 -0700 |
commit | cf5f1f1420b472477317b0ea0fa7f6456d2605cf (patch) | |
tree | 740eceb5691a6897e32be979e1f3d5d06831470b /chrome_browser_proxy_resolver.h | |
parent | d7da8f4118c10d00d02b6274edd2f88971a6cb22 (diff) | |
download | android_system_update_engine-cf5f1f1420b472477317b0ea0fa7f6456d2605cf.tar.gz android_system_update_engine-cf5f1f1420b472477317b0ea0fa7f6456d2605cf.tar.bz2 android_system_update_engine-cf5f1f1420b472477317b0ea0fa7f6456d2605cf.zip |
Update to use libbrillo Chrome proxy resolver
This uses the new proxy resolution code in libbrillo for doing proxy
resolution rather than making the D-Bus calls directly through the
generated bindings. The unittest for this class was removed since the
main function of it was removed. It now is essentially just a wrapper
around the call into libbrillo along with some minimal code for
allowing cancelling of callbacks.
BUG=chromium:771386
TEST=Unit tests pass
Change-Id: Ib0d4e413482f4bdfe0e9689f68118efbec94ec9d
Reviewed-on: https://chromium-review.googlesource.com/698964
Commit-Ready: Jeffrey Kardatzke <jkardatzke@google.com>
Tested-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: Sen Jiang <senj@chromium.org>
Diffstat (limited to 'chrome_browser_proxy_resolver.h')
-rw-r--r-- | chrome_browser_proxy_resolver.h | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/chrome_browser_proxy_resolver.h b/chrome_browser_proxy_resolver.h index 03dbdad5..fcf85b68 100644 --- a/chrome_browser_proxy_resolver.h +++ b/chrome_browser_proxy_resolver.h @@ -20,46 +20,29 @@ #include <deque> #include <map> #include <string> +#include <vector> #include <base/memory/weak_ptr.h> #include "update_engine/proxy_resolver.h" -namespace brillo { -class Error; -} // namespace brillo - -namespace org { -namespace chromium { -class NetworkProxyServiceInterfaceProxyInterface; -} // namespace chromium -} // namespace org - namespace chromeos_update_engine { class ChromeBrowserProxyResolver : public ProxyResolver { public: - explicit ChromeBrowserProxyResolver( - org::chromium::NetworkProxyServiceInterfaceProxyInterface* dbus_proxy); + ChromeBrowserProxyResolver(); ~ChromeBrowserProxyResolver() override; - // Parses a string-encoded list of proxies and returns a deque - // of individual proxies. The last one will always be kNoProxy. - static std::deque<std::string> ParseProxyString(const std::string& input); - // ProxyResolver: ProxyRequestId GetProxiesForUrl(const std::string& url, const ProxiesResolvedFn& callback) override; bool CancelProxyRequest(ProxyRequestId request) override; -private: - // Callback for successful D-Bus calls made by GetProxiesForUrl(). - void OnResolveProxyResponse(ProxyRequestId request_id, - const std::string& proxy_info, - const std::string& error_message); - - // Callback for failed D-Bus calls made by GetProxiesForUrl(). - void OnResolveProxyError(ProxyRequestId request_id, brillo::Error* error); + private: + // Callback for calls made by GetProxiesForUrl(). + void OnGetChromeProxyServers(ProxyRequestId request_id, + bool success, + const std::vector<std::string>& proxies); // Finds the callback identified by |request_id| in |pending_callbacks_|, // passes |proxies| to it, and deletes it. Does nothing if the request has @@ -67,9 +50,6 @@ private: void RunCallback(ProxyRequestId request_id, const std::deque<std::string>& proxies); - // D-Bus proxy for resolving network proxies. - org::chromium::NetworkProxyServiceInterfaceProxyInterface* dbus_proxy_; - // Next ID to return from GetProxiesForUrl(). ProxyRequestId next_request_id_; |