Index: proxy_resolver.h |
diff --git a/proxy_resolver.h b/proxy_resolver.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..41b6cf5edbaba2484e23731f2221d3a0757fc56c |
--- /dev/null |
+++ b/proxy_resolver.h |
@@ -0,0 +1,46 @@ |
+// Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_PROXY_RESOLVER_H__ |
+#define CHROMEOS_PLATFORM_UPDATE_ENGINE_PROXY_RESOLVER_H__ |
+ |
+#include <base/logging.h> |
+ |
+#include <string> |
+#include <vector> |
+ |
+namespace chromeos_update_engine { |
+ |
+extern const char kNoProxy[]; |
+ |
+class ProxyResolver { |
+ public: |
+ ProxyResolver() {} |
+ virtual ~ProxyResolver() {} |
+ |
+ // Stores a proxy for a given |url| in |out_proxy|. Returns true on success. |
petkov
2010/11/19 01:09:19
Stores a list of proxies for a given ...
adlr
2010/11/19 02:00:52
Done.
|
+ // The resultant proxy will be in one of the following forms: |
+ // http://<host>[:<port>] - HTTP proxy |
+ // socks{4,5}://<host>[:<port>] - SOCKS4/5 proxy |
+ // kNoProxy - no proxy |
+ virtual bool GetProxiesForUrl(const std::string& url, |
+ std::vector<std::string>* out_proxies) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ProxyResolver); |
+}; |
+ |
+// Always says to not use a proxy |
+class DirectProxyResolver : public ProxyResolver { |
+ public: |
+ virtual bool GetProxiesForUrl(const std::string& url, |
+ std::vector<std::string>* out_proxies); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(DirectProxyResolver); |
+}; |
+ |
+} // namespace chromeos_update_engine |
+ |
+#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PROXY_RESOLVER_H__ |