Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // 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.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_PROXY_RESOLVER_H__ | |
| 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_PROXY_RESOLVER_H__ | |
| 7 | |
| 8 #include <string> | |
| 9 #include <vector> | |
| 10 | |
| 11 namespace chromeos_update_engine { | |
| 12 | |
| 13 extern const char kNoProxy[]; | |
| 14 | |
| 15 class ProxyResolver { | |
| 16 public: | |
| 17 ProxyResolver() {} | |
| 18 virtual ~ProxyResolver() {} | |
| 19 | |
| 20 // Stores a proxy for a given |url| in |out_proxy|. Returns true on success. | |
| 21 // The resultant proxy will be in one of the following forms: | |
| 22 // http://<host>[:<port>] - HTTP proxy | |
| 23 // socks{4,5}://<host>[:<port>] - SOCKS4/5 proxy | |
| 24 // empy string - no proxy | |
|
petkov
2010/11/18 23:26:46
typo: empty
adlr
2010/11/19 00:41:06
comment was outdated. fixed
| |
| 25 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
| |
| 26 std::vector<std::string>* out_proxies) = 0; | |
| 27 }; | |
|
petkov
2010/11/18 23:26:46
DISALLOW_COPY_AND_ASSIGN?
adlr
2010/11/19 00:41:06
Done.
| |
| 28 | |
| 29 // Always says to not use a proxy | |
| 30 class DirectProxyResolver : public ProxyResolver { | |
| 31 virtual bool ProxyForUrl(const std::string& url, | |
| 32 std::vector<std::string>* out_proxies) { | |
| 33 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.
| |
| 34 out_proxies->push_back(kNoProxy); | |
| 35 return true; | |
| 36 } | |
| 37 }; | |
|
petkov
2010/11/18 23:26:46
DISALLOW_COPY_AND_ASSIGN?
adlr
2010/11/19 00:41:06
Done.
| |
| 38 | |
| 39 } // namespace chromeos_update_engine | |
| 40 | |
| 41 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_PROXY_RESOLVER_H__ | |
| OLD | NEW |