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

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

Issue 837223007: Add note on ProxyInfo::UseDirect(), etc. to warn that they reset the instance (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | net/proxy/proxy_service.cc » ('j') | 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) 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/time.h" 10 #include "base/time/time.h"
(...skipping 10 matching lines...) Expand all
21 class NET_EXPORT ProxyInfo { 21 class NET_EXPORT ProxyInfo {
22 public: 22 public:
23 ProxyInfo(); 23 ProxyInfo();
24 ~ProxyInfo(); 24 ~ProxyInfo();
25 // Default copy-constructor and assignment operator are OK! 25 // Default copy-constructor and assignment operator are OK!
26 26
27 // Uses the same proxy server as the given |proxy_info|. 27 // Uses the same proxy server as the given |proxy_info|.
28 void Use(const ProxyInfo& proxy_info); 28 void Use(const ProxyInfo& proxy_info);
29 29
30 // Uses a direct connection. 30 // Uses a direct connection.
31 //
32 // Note that this method resets this instance unlike Fallback(), etc. which
33 // only modify |proxy_list_|. For example, since |config_id_| is cleared,
34 // ProxyService recognizes this instance as a new config after UseDirect()
35 // call.
mmenke 2015/01/09 21:11:14 "ProxyService recognizes" -> "the ProxyService may
tyoshino (SeeGerritForStatus) 2015/01/14 04:20:36 Done.
31 void UseDirect(); 36 void UseDirect();
32 37
33 // Uses a direct connection. did_bypass_proxy() will return true to indicate 38 // Uses a direct connection. did_bypass_proxy() will return true to indicate
34 // that the direct connection is the result of configured proxy bypass rules. 39 // that the direct connection is the result of configured proxy bypass rules.
40 //
41 // See also the note for UseDirect().
35 void UseDirectWithBypassedProxy(); 42 void UseDirectWithBypassedProxy();
36 43
37 // Uses a specific proxy server, of the form: 44 // Uses a specific proxy server, of the form:
38 // proxy-uri = [<scheme> "://"] <hostname> [":" <port>] 45 // proxy-uri = [<scheme> "://"] <hostname> [":" <port>]
39 // This may optionally be a semi-colon delimited list of <proxy-uri>. 46 // This may optionally be a semi-colon delimited list of <proxy-uri>.
40 // It is OK to have LWS between entries. 47 // It is OK to have LWS between entries.
48 //
49 // See also the note for UseDirect().
41 void UseNamedProxy(const std::string& proxy_uri_list); 50 void UseNamedProxy(const std::string& proxy_uri_list);
42 51
43 // Sets the proxy list to a single entry, |proxy_server|. 52 // Sets the proxy list to a single entry, |proxy_server|.
53 //
54 // See also the note for UseDirect().
44 void UseProxyServer(const ProxyServer& proxy_server); 55 void UseProxyServer(const ProxyServer& proxy_server);
45 56
46 // Parses from the given PAC result. 57 // Parses from the given PAC result.
58 //
59 // See also the note for UseDirect().
47 void UsePacString(const std::string& pac_string); 60 void UsePacString(const std::string& pac_string);
48 61
49 // Use the proxies from the given list. 62 // Use the proxies from the given list.
63 //
64 // See also the note for UseDirect().
50 void UseProxyList(const ProxyList& proxy_list); 65 void UseProxyList(const ProxyList& proxy_list);
51 66
52 // Returns true if this proxy info specifies a direct connection. 67 // Returns true if this proxy info specifies a direct connection.
53 bool is_direct() const { 68 bool is_direct() const {
54 // We don't implicitly fallback to DIRECT unless it was added to the list. 69 // We don't implicitly fallback to DIRECT unless it was added to the list.
55 if (is_empty()) 70 if (is_empty())
56 return false; 71 return false;
57 return proxy_list_.Get().is_direct(); 72 return proxy_list_.Get().is_direct();
58 } 73 }
59 74
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 190
176 // How long it took to resolve the proxy. Times are both null if proxy was 191 // How long it took to resolve the proxy. Times are both null if proxy was
177 // determined synchronously without running a PAC. 192 // determined synchronously without running a PAC.
178 base::TimeTicks proxy_resolve_start_time_; 193 base::TimeTicks proxy_resolve_start_time_;
179 base::TimeTicks proxy_resolve_end_time_; 194 base::TimeTicks proxy_resolve_end_time_;
180 }; 195 };
181 196
182 } // namespace net 197 } // namespace net
183 198
184 #endif // NET_PROXY_PROXY_INFO_H_ 199 #endif // NET_PROXY_PROXY_INFO_H_
OLDNEW
« no previous file with comments | « no previous file | net/proxy/proxy_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698