Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: proxy_resolver.h

Issue 5151005: AU: Proxy Resolver classes (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fix whitespace Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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__

Powered by Google App Engine
This is Rietveld 408576698