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

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

Issue 12315019: Change ProxyRules to handle ProxyLists rather than just single ProxyServer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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 | « net/proxy/proxy_info.h ('k') | net/proxy/proxy_list.h » ('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 #include "net/proxy/proxy_info.h" 5 #include "net/proxy/proxy_info.h"
6 6
7 #include "net/proxy/proxy_retry_info.h" 7 #include "net/proxy/proxy_retry_info.h"
8 8
9 namespace net { 9 namespace net {
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) { 42 void ProxyInfo::UseNamedProxy(const std::string& proxy_uri_list) {
43 Reset(); 43 Reset();
44 proxy_list_.Set(proxy_uri_list); 44 proxy_list_.Set(proxy_uri_list);
45 } 45 }
46 46
47 void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) { 47 void ProxyInfo::UseProxyServer(const ProxyServer& proxy_server) {
48 Reset(); 48 Reset();
49 proxy_list_.SetSingleProxyServer(proxy_server); 49 proxy_list_.SetSingleProxyServer(proxy_server);
50 } 50 }
51 51
52 void ProxyInfo::UsePacString(const std::string& pac_string) {
53 Reset();
54 proxy_list_.SetFromPacString(pac_string);
55 }
56
57 void ProxyInfo::UseProxyList(const ProxyList& proxy_list) {
58 Reset();
59 proxy_list_ = proxy_list;
60 }
61
52 std::string ProxyInfo::ToPacString() const { 62 std::string ProxyInfo::ToPacString() const {
53 return proxy_list_.ToPacString(); 63 return proxy_list_.ToPacString();
54 } 64 }
55 65
56 bool ProxyInfo::Fallback(const BoundNetLog& net_log) { 66 bool ProxyInfo::Fallback(const BoundNetLog& net_log) {
57 return proxy_list_.Fallback(&proxy_retry_info_, net_log); 67 return proxy_list_.Fallback(&proxy_retry_info_, net_log);
58 } 68 }
59 69
60 void ProxyInfo::DeprioritizeBadProxies( 70 void ProxyInfo::DeprioritizeBadProxies(
61 const ProxyRetryInfoMap& proxy_retry_info) { 71 const ProxyRetryInfoMap& proxy_retry_info) {
62 proxy_list_.DeprioritizeBadProxies(proxy_retry_info); 72 proxy_list_.DeprioritizeBadProxies(proxy_retry_info);
63 } 73 }
64 74
65 void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) { 75 void ProxyInfo::RemoveProxiesWithoutScheme(int scheme_bit_field) {
66 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field); 76 proxy_list_.RemoveProxiesWithoutScheme(scheme_bit_field);
67 } 77 }
68 78
69 void ProxyInfo::Reset() { 79 void ProxyInfo::Reset() {
70 proxy_resolve_start_time_ = base::TimeTicks(); 80 proxy_resolve_start_time_ = base::TimeTicks();
71 proxy_resolve_end_time_ = base::TimeTicks(); 81 proxy_resolve_end_time_ = base::TimeTicks();
72 proxy_list_.Clear(); 82 proxy_list_.Clear();
73 proxy_retry_info_.clear(); 83 proxy_retry_info_.clear();
74 config_id_ = ProxyConfig::kInvalidConfigID; 84 config_id_ = ProxyConfig::kInvalidConfigID;
75 config_source_ = PROXY_CONFIG_SOURCE_UNKNOWN; 85 config_source_ = PROXY_CONFIG_SOURCE_UNKNOWN;
76 did_bypass_proxy_ = false; 86 did_bypass_proxy_ = false;
77 did_use_pac_script_ = false; 87 did_use_pac_script_ = false;
78 } 88 }
79 89
80 } // namespace net 90 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_info.h ('k') | net/proxy/proxy_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698