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

Side by Side Diff: net/proxy/proxy_info.h

Issue 1809001: Remove proxy_mode_ from the HttpNetworkTransaction since it... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "net/proxy/proxy_config.h" 10 #include "net/proxy/proxy_config.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 // Returns true if this proxy info specifies a direct connection. 45 // Returns true if this proxy info specifies a direct connection.
46 bool is_direct() const { 46 bool is_direct() const {
47 // We don't implicitly fallback to DIRECT unless it was added to the list. 47 // We don't implicitly fallback to DIRECT unless it was added to the list.
48 if (is_empty()) 48 if (is_empty())
49 return false; 49 return false;
50 return proxy_list_.Get().is_direct(); 50 return proxy_list_.Get().is_direct();
51 } 51 }
52 52
53 // Returns true if the first valid proxy server is a http proxy.
54 bool is_http() const {
55 if (is_empty())
56 return false;
57 return proxy_server().is_http();
58 }
59
60 // Returns true if the first valid proxy server is a socks server.
61 bool is_socks() const {
62 if (is_empty())
63 return false;
64 return proxy_server().is_socks();
65 }
66
53 // Returns true if this proxy info has no proxies left to try. 67 // Returns true if this proxy info has no proxies left to try.
54 bool is_empty() const { 68 bool is_empty() const {
55 return proxy_list_.IsEmpty(); 69 return proxy_list_.IsEmpty();
56 } 70 }
57 71
58 // Returns the first valid proxy server. is_empty() must be false to be able 72 // Returns the first valid proxy server. is_empty() must be false to be able
59 // to call this function. 73 // to call this function.
60 ProxyServer proxy_server() const { return proxy_list_.Get(); } 74 ProxyServer proxy_server() const { return proxy_list_.Get(); }
61 75
62 // See description in ProxyList::ToPacString(). 76 // See description in ProxyList::ToPacString().
(...skipping 23 matching lines...) Expand all
86 // try. If proxy_list_ is empty, then there is nothing left to fall back to. 100 // try. If proxy_list_ is empty, then there is nothing left to fall back to.
87 ProxyList proxy_list_; 101 ProxyList proxy_list_;
88 102
89 // This value identifies the proxy config used to initialize this object. 103 // This value identifies the proxy config used to initialize this object.
90 ProxyConfig::ID config_id_; 104 ProxyConfig::ID config_id_;
91 }; 105 };
92 106
93 } // namespace net 107 } // namespace net
94 108
95 #endif // NET_PROXY_PROXY_INFO_H_ 109 #endif // NET_PROXY_PROXY_INFO_H_
OLDNEW
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698