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

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: merge master 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
« no previous file with comments | « mock_dbus_interface.h ('k') | proxy_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: proxy_resolver.h
diff --git a/proxy_resolver.h b/proxy_resolver.h
new file mode 100644
index 0000000000000000000000000000000000000000..5d9064c13fa5e693ec0dd5430b9ef3f87acf76c7
--- /dev/null
+++ b/proxy_resolver.h
@@ -0,0 +1,47 @@
+// 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 list of proxies for a given |url| in |out_proxy|.
+ // Returns true on success. 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__
« no previous file with comments | « mock_dbus_interface.h ('k') | proxy_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698