| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_PROXY_PROXY_INFO_H_ | 5 #ifndef NET_PROXY_PROXY_INFO_H_ |
| 6 #define NET_PROXY_PROXY_INFO_H_ | 6 #define NET_PROXY_PROXY_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // Uses a specific proxy server, of the form: | 37 // Uses a specific proxy server, of the form: |
| 38 // proxy-uri = [<scheme> "://"] <hostname> [":" <port>] | 38 // proxy-uri = [<scheme> "://"] <hostname> [":" <port>] |
| 39 // This may optionally be a semi-colon delimited list of <proxy-uri>. | 39 // This may optionally be a semi-colon delimited list of <proxy-uri>. |
| 40 // It is OK to have LWS between entries. | 40 // It is OK to have LWS between entries. |
| 41 void UseNamedProxy(const std::string& proxy_uri_list); | 41 void UseNamedProxy(const std::string& proxy_uri_list); |
| 42 | 42 |
| 43 // Sets the proxy list to a single entry, |proxy_server|. | 43 // Sets the proxy list to a single entry, |proxy_server|. |
| 44 void UseProxyServer(const ProxyServer& proxy_server); | 44 void UseProxyServer(const ProxyServer& proxy_server); |
| 45 | 45 |
| 46 // Parses from the given PAC result. | 46 // Parses from the given PAC result. |
| 47 void UsePacString(const std::string& pac_string) { | 47 void UsePacString(const std::string& pac_string); |
| 48 proxy_list_.SetFromPacString(pac_string); | |
| 49 } | |
| 50 | 48 |
| 51 // Returns true if this proxy info specifies a direct connection. | 49 // Returns true if this proxy info specifies a direct connection. |
| 52 bool is_direct() const { | 50 bool is_direct() const { |
| 53 // We don't implicitly fallback to DIRECT unless it was added to the list. | 51 // We don't implicitly fallback to DIRECT unless it was added to the list. |
| 54 if (is_empty()) | 52 if (is_empty()) |
| 55 return false; | 53 return false; |
| 56 return proxy_list_.Get().is_direct(); | 54 return proxy_list_.Get().is_direct(); |
| 57 } | 55 } |
| 58 | 56 |
| 59 bool is_direct_only() const { | 57 bool is_direct_only() const { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 157 |
| 160 // How long it took to resolve the proxy. Times are both null if proxy was | 158 // How long it took to resolve the proxy. Times are both null if proxy was |
| 161 // determined synchronously without running a PAC. | 159 // determined synchronously without running a PAC. |
| 162 base::TimeTicks proxy_resolve_start_time_; | 160 base::TimeTicks proxy_resolve_start_time_; |
| 163 base::TimeTicks proxy_resolve_end_time_; | 161 base::TimeTicks proxy_resolve_end_time_; |
| 164 }; | 162 }; |
| 165 | 163 |
| 166 } // namespace net | 164 } // namespace net |
| 167 | 165 |
| 168 #endif // NET_PROXY_PROXY_INFO_H_ | 166 #endif // NET_PROXY_PROXY_INFO_H_ |
| OLD | NEW |