123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef UPDATE_ENGINE_CHROME_BROWSER_PROXY_RESOLVER_H_
- #define UPDATE_ENGINE_CHROME_BROWSER_PROXY_RESOLVER_H_
- #include <deque>
- #include <map>
- #include <string>
- #include <vector>
- #include <base/memory/weak_ptr.h>
- #include "update_engine/common/proxy_resolver.h"
- namespace chromeos_update_engine {
- class ChromeBrowserProxyResolver : public ProxyResolver {
- public:
- ChromeBrowserProxyResolver();
- ~ChromeBrowserProxyResolver() override;
-
- ProxyRequestId GetProxiesForUrl(const std::string& url,
- const ProxiesResolvedFn& callback) override;
- bool CancelProxyRequest(ProxyRequestId request) override;
- private:
-
- void OnGetChromeProxyServers(ProxyRequestId request_id,
- bool success,
- const std::vector<std::string>& proxies);
-
-
-
- void RunCallback(ProxyRequestId request_id,
- const std::deque<std::string>& proxies);
-
- ProxyRequestId next_request_id_;
-
- std::map<ProxyRequestId, ProxiesResolvedFn> pending_callbacks_;
- base::WeakPtrFactory<ChromeBrowserProxyResolver> weak_ptr_factory_;
- DISALLOW_COPY_AND_ASSIGN(ChromeBrowserProxyResolver);
- };
- }
- #endif
|