Chromium Code Reviews| Index: proxy_resolver.h |
| diff --git a/proxy_resolver.h b/proxy_resolver.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0a8aa628e385f26635e6e6f60a2f7ee5d8602763 |
| --- /dev/null |
| +++ b/proxy_resolver.h |
| @@ -0,0 +1,41 @@ |
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
|
petkov
2010/11/18 23:26:46
Chromium OS
adlr
2010/11/19 00:41:06
Done.
|
| +// 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 <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. |
| + // The resultant proxy will be in one of the following forms: |
| + // http://<host>[:<port>] - HTTP proxy |
| + // socks{4,5}://<host>[:<port>] - SOCKS4/5 proxy |
| + // empy string - no proxy |
|
petkov
2010/11/18 23:26:46
typo: empty
adlr
2010/11/19 00:41:06
comment was outdated. fixed
|
| + virtual bool ProxyForUrl(const std::string& url, |
|
petkov
2010/11/18 23:26:46
You should rename most of the new methods to inclu
adlr
2010/11/19 00:41:06
done, i think.
petkov
2010/11/19 01:09:19
Ugly. They also use kOK. And we have JSONParser cl
adlr
2010/11/19 02:00:52
If you look at the update_engine code today, we us
|
| + std::vector<std::string>* out_proxies) = 0; |
| +}; |
|
petkov
2010/11/18 23:26:46
DISALLOW_COPY_AND_ASSIGN?
adlr
2010/11/19 00:41:06
Done.
|
| + |
| +// Always says to not use a proxy |
| +class DirectProxyResolver : public ProxyResolver { |
| + virtual bool ProxyForUrl(const std::string& url, |
| + std::vector<std::string>* out_proxies) { |
| + out_proxies->clear(); |
|
petkov
2010/11/18 23:26:46
I'd suggest moving this code to the .cc file.
adlr
2010/11/19 00:41:06
Done.
|
| + out_proxies->push_back(kNoProxy); |
| + return true; |
| + } |
| +}; |
|
petkov
2010/11/18 23:26:46
DISALLOW_COPY_AND_ASSIGN?
adlr
2010/11/19 00:41:06
Done.
|
| + |
| +} // namespace chromeos_update_engine |
| + |
| +#endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PROXY_RESOLVER_H__ |