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

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

Issue 1684123004: Bypass the DataReductionProxy for all POST requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing a DHECK, changing FTP Job to always pass in "GET" as method, adding more unittest coverage Created 4 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
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_service.h" 5 #include "net/proxy/proxy_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 const ProxyService::PacPollPolicy* 745 const ProxyService::PacPollPolicy*
746 ProxyService::ProxyScriptDeciderPoller::poll_policy_ = NULL; 746 ProxyService::ProxyScriptDeciderPoller::poll_policy_ = NULL;
747 747
748 // ProxyService::PacRequest --------------------------------------------------- 748 // ProxyService::PacRequest ---------------------------------------------------
749 749
750 class ProxyService::PacRequest 750 class ProxyService::PacRequest
751 : public base::RefCounted<ProxyService::PacRequest> { 751 : public base::RefCounted<ProxyService::PacRequest> {
752 public: 752 public:
753 PacRequest(ProxyService* service, 753 PacRequest(ProxyService* service,
754 const GURL& url, 754 const GURL& url,
755 const std::string& method,
755 int load_flags, 756 int load_flags,
756 ProxyDelegate* proxy_delegate, 757 ProxyDelegate* proxy_delegate,
757 ProxyInfo* results, 758 ProxyInfo* results,
758 const CompletionCallback& user_callback, 759 const CompletionCallback& user_callback,
759 const BoundNetLog& net_log) 760 const BoundNetLog& net_log)
760 : service_(service), 761 : service_(service),
761 user_callback_(user_callback), 762 user_callback_(user_callback),
762 results_(results), 763 results_(results),
763 url_(url), 764 url_(url),
765 method_(method),
764 load_flags_(load_flags), 766 load_flags_(load_flags),
765 proxy_delegate_(proxy_delegate), 767 proxy_delegate_(proxy_delegate),
766 config_id_(ProxyConfig::kInvalidConfigID), 768 config_id_(ProxyConfig::kInvalidConfigID),
767 config_source_(PROXY_CONFIG_SOURCE_UNKNOWN), 769 config_source_(PROXY_CONFIG_SOURCE_UNKNOWN),
768 net_log_(net_log), 770 net_log_(net_log),
769 creation_time_(TimeTicks::Now()) { 771 creation_time_(TimeTicks::Now()) {
770 DCHECK(!user_callback.is_null()); 772 DCHECK(!user_callback.is_null());
771 } 773 }
772 774
773 // Starts the resolve proxy request. 775 // Starts the resolve proxy request.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 835
834 // This state is cleared when resolve_job_ is reset below. 836 // This state is cleared when resolve_job_ is reset below.
835 bool script_executed = is_started(); 837 bool script_executed = is_started();
836 838
837 // Clear |resolve_job_| so is_started() returns false while 839 // Clear |resolve_job_| so is_started() returns false while
838 // DidFinishResolvingProxy() runs. 840 // DidFinishResolvingProxy() runs.
839 resolve_job_.reset(); 841 resolve_job_.reset();
840 842
841 // Note that DidFinishResolvingProxy might modify |results_|. 843 // Note that DidFinishResolvingProxy might modify |results_|.
842 int rv = service_->DidFinishResolvingProxy( 844 int rv = service_->DidFinishResolvingProxy(
843 url_, load_flags_, proxy_delegate_, results_, result_code, net_log_, 845 url_, method_, load_flags_, proxy_delegate_, results_, result_code,
844 creation_time_, script_executed); 846 net_log_, creation_time_, script_executed);
845 847
846 // Make a note in the results which configuration was in use at the 848 // Make a note in the results which configuration was in use at the
847 // time of the resolve. 849 // time of the resolve.
848 results_->config_id_ = config_id_; 850 results_->config_id_ = config_id_;
849 results_->config_source_ = config_source_; 851 results_->config_source_ = config_source_;
850 results_->did_use_pac_script_ = true; 852 results_->did_use_pac_script_ = true;
851 results_->proxy_resolve_start_time_ = creation_time_; 853 results_->proxy_resolve_start_time_ = creation_time_;
852 results_->proxy_resolve_end_time_ = TimeTicks::Now(); 854 results_->proxy_resolve_end_time_ = TimeTicks::Now();
853 855
854 // Reset the state associated with in-progress-resolve. 856 // Reset the state associated with in-progress-resolve.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 888
887 ProxyResolver* resolver() const { return service_->resolver_.get(); } 889 ProxyResolver* resolver() const { return service_->resolver_.get(); }
888 890
889 // Note that we don't hold a reference to the ProxyService. Outstanding 891 // Note that we don't hold a reference to the ProxyService. Outstanding
890 // requests are cancelled during ~ProxyService, so this is guaranteed 892 // requests are cancelled during ~ProxyService, so this is guaranteed
891 // to be valid throughout our lifetime. 893 // to be valid throughout our lifetime.
892 ProxyService* service_; 894 ProxyService* service_;
893 CompletionCallback user_callback_; 895 CompletionCallback user_callback_;
894 ProxyInfo* results_; 896 ProxyInfo* results_;
895 GURL url_; 897 GURL url_;
898 std::string method_;
896 int load_flags_; 899 int load_flags_;
897 ProxyDelegate* proxy_delegate_; 900 ProxyDelegate* proxy_delegate_;
898 scoped_ptr<ProxyResolver::Request> resolve_job_; 901 scoped_ptr<ProxyResolver::Request> resolve_job_;
899 ProxyConfig::ID config_id_; // The config id when the resolve was started. 902 ProxyConfig::ID config_id_; // The config id when the resolve was started.
900 ProxyConfigSource config_source_; // The source of proxy settings. 903 ProxyConfigSource config_source_; // The source of proxy settings.
901 BoundNetLog net_log_; 904 BoundNetLog net_log_;
902 // Time when the request was created. Stored here rather than in |results_| 905 // Time when the request was created. Stored here rather than in |results_|
903 // because the time in |results_| will be cleared. 906 // because the time in |results_| will be cleared.
904 TimeTicks creation_time_; 907 TimeTicks creation_time_;
905 }; 908 };
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 // ProxyResolver dependency we give it will never be used. 988 // ProxyResolver dependency we give it will never be used.
986 scoped_ptr<ProxyConfigService> proxy_config_service( 989 scoped_ptr<ProxyConfigService> proxy_config_service(
987 new ProxyConfigServiceFixed(ProxyConfig::CreateAutoDetect())); 990 new ProxyConfigServiceFixed(ProxyConfig::CreateAutoDetect()));
988 991
989 return make_scoped_ptr(new ProxyService( 992 return make_scoped_ptr(new ProxyService(
990 std::move(proxy_config_service), 993 std::move(proxy_config_service),
991 make_scoped_ptr(new ProxyResolverFactoryForPacResult(pac_string)), NULL)); 994 make_scoped_ptr(new ProxyResolverFactoryForPacResult(pac_string)), NULL));
992 } 995 }
993 996
994 int ProxyService::ResolveProxy(const GURL& raw_url, 997 int ProxyService::ResolveProxy(const GURL& raw_url,
998 const std::string& method,
995 int load_flags, 999 int load_flags,
996 ProxyInfo* result, 1000 ProxyInfo* result,
997 const CompletionCallback& callback, 1001 const CompletionCallback& callback,
998 PacRequest** pac_request, 1002 PacRequest** pac_request,
999 ProxyDelegate* proxy_delegate, 1003 ProxyDelegate* proxy_delegate,
1000 const BoundNetLog& net_log) { 1004 const BoundNetLog& net_log) {
1001 DCHECK(!callback.is_null()); 1005 DCHECK(!callback.is_null());
1002 return ResolveProxyHelper(raw_url, load_flags, result, callback, pac_request, 1006 return ResolveProxyHelper(raw_url, method, load_flags, result, callback,
1003 proxy_delegate, net_log); 1007 pac_request, proxy_delegate, net_log);
1004 } 1008 }
1005 1009
1006 int ProxyService::ResolveProxyHelper(const GURL& raw_url, 1010 int ProxyService::ResolveProxyHelper(const GURL& raw_url,
1011 const std::string& method,
1007 int load_flags, 1012 int load_flags,
1008 ProxyInfo* result, 1013 ProxyInfo* result,
1009 const CompletionCallback& callback, 1014 const CompletionCallback& callback,
1010 PacRequest** pac_request, 1015 PacRequest** pac_request,
1011 ProxyDelegate* proxy_delegate, 1016 ProxyDelegate* proxy_delegate,
1012 const BoundNetLog& net_log) { 1017 const BoundNetLog& net_log) {
1013 DCHECK(CalledOnValidThread()); 1018 DCHECK(CalledOnValidThread());
1014 1019
1015 net_log.BeginEvent(NetLog::TYPE_PROXY_SERVICE); 1020 net_log.BeginEvent(NetLog::TYPE_PROXY_SERVICE);
1016 1021
1017 // Notify our polling-based dependencies that a resolve is taking place. 1022 // Notify our polling-based dependencies that a resolve is taking place.
1018 // This way they can schedule their polls in response to network activity. 1023 // This way they can schedule their polls in response to network activity.
1019 config_service_->OnLazyPoll(); 1024 config_service_->OnLazyPoll();
1020 if (script_poller_.get()) 1025 if (script_poller_.get())
1021 script_poller_->OnLazyPoll(); 1026 script_poller_->OnLazyPoll();
1022 1027
1023 if (current_state_ == STATE_NONE) 1028 if (current_state_ == STATE_NONE)
1024 ApplyProxyConfigIfAvailable(); 1029 ApplyProxyConfigIfAvailable();
1025 1030
1026 // Strip away any reference fragments and the username/password, as they 1031 // Strip away any reference fragments and the username/password, as they
1027 // are not relevant to proxy resolution. 1032 // are not relevant to proxy resolution.
1028 GURL url = SimplifyUrlForRequest(raw_url); 1033 GURL url = SimplifyUrlForRequest(raw_url);
1029 1034
1030 // Check if the request can be completed right away. (This is the case when 1035 // Check if the request can be completed right away. (This is the case when
1031 // using a direct connection for example). 1036 // using a direct connection for example).
1032 int rv = TryToCompleteSynchronously(url, load_flags, proxy_delegate, result); 1037 int rv = TryToCompleteSynchronously(url, load_flags, proxy_delegate, result);
1033 if (rv != ERR_IO_PENDING) { 1038 if (rv != ERR_IO_PENDING) {
1034 rv = DidFinishResolvingProxy( 1039 rv = DidFinishResolvingProxy(
1035 url, load_flags, proxy_delegate, result, rv, net_log, 1040 url, method, load_flags, proxy_delegate, result, rv, net_log,
1036 callback.is_null() ? TimeTicks() : TimeTicks::Now(), false); 1041 callback.is_null() ? TimeTicks() : TimeTicks::Now(), false);
1037 return rv; 1042 return rv;
1038 } 1043 }
1039 1044
1040 if (callback.is_null()) 1045 if (callback.is_null())
1041 return ERR_IO_PENDING; 1046 return ERR_IO_PENDING;
1042 1047
1043 scoped_refptr<PacRequest> req(new PacRequest( 1048 scoped_refptr<PacRequest> req(new PacRequest(this, url, method, load_flags,
1044 this, url, load_flags, proxy_delegate, result, callback, net_log)); 1049 proxy_delegate, result, callback,
1050 net_log));
1045 1051
1046 if (current_state_ == STATE_READY) { 1052 if (current_state_ == STATE_READY) {
1047 // Start the resolve request. 1053 // Start the resolve request.
1048 rv = req->Start(); 1054 rv = req->Start();
1049 if (rv != ERR_IO_PENDING) 1055 if (rv != ERR_IO_PENDING)
1050 return req->QueryDidComplete(rv); 1056 return req->QueryDidComplete(rv);
1051 } else { 1057 } else {
1052 req->net_log()->BeginEvent(NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC); 1058 req->net_log()->BeginEvent(NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC);
1053 } 1059 }
1054 1060
1055 DCHECK_EQ(ERR_IO_PENDING, rv); 1061 DCHECK_EQ(ERR_IO_PENDING, rv);
1056 DCHECK(!ContainsPendingRequest(req.get())); 1062 DCHECK(!ContainsPendingRequest(req.get()));
1057 pending_requests_.insert(req); 1063 pending_requests_.insert(req);
1058 1064
1059 // Completion will be notified through |callback|, unless the caller cancels 1065 // Completion will be notified through |callback|, unless the caller cancels
1060 // the request using |pac_request|. 1066 // the request using |pac_request|.
1061 if (pac_request) 1067 if (pac_request)
1062 *pac_request = req.get(); 1068 *pac_request = req.get();
1063 return rv; // ERR_IO_PENDING 1069 return rv; // ERR_IO_PENDING
1064 } 1070 }
1065 1071
1066 bool ProxyService::TryResolveProxySynchronously(const GURL& raw_url, 1072 bool ProxyService::TryResolveProxySynchronously(const GURL& raw_url,
1073 const std::string& method,
1067 int load_flags, 1074 int load_flags,
1068 ProxyInfo* result, 1075 ProxyInfo* result,
1069 ProxyDelegate* proxy_delegate, 1076 ProxyDelegate* proxy_delegate,
1070 const BoundNetLog& net_log) { 1077 const BoundNetLog& net_log) {
1071 CompletionCallback null_callback; 1078 CompletionCallback null_callback;
1072 return ResolveProxyHelper(raw_url, load_flags, result, null_callback, 1079 return ResolveProxyHelper(raw_url, method, load_flags, result, null_callback,
1073 nullptr /* pac_request*/, proxy_delegate, 1080 nullptr /* pac_request*/, proxy_delegate,
1074 net_log) == OK; 1081 net_log) == OK;
1075 } 1082 }
1076 1083
1077 int ProxyService::TryToCompleteSynchronously(const GURL& url, 1084 int ProxyService::TryToCompleteSynchronously(const GURL& url,
1078 int load_flags, 1085 int load_flags,
1079 ProxyDelegate* proxy_delegate, 1086 ProxyDelegate* proxy_delegate,
1080 ProxyInfo* result) { 1087 ProxyInfo* result) {
1081 DCHECK_NE(STATE_NONE, current_state_); 1088 DCHECK_NE(STATE_NONE, current_state_);
1082 1089
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 // due to ProxyScriptDeciderPoller. 1229 // due to ProxyScriptDeciderPoller.
1223 config_.set_id(fetched_config_.id()); 1230 config_.set_id(fetched_config_.id());
1224 config_.set_source(fetched_config_.source()); 1231 config_.set_source(fetched_config_.source());
1225 1232
1226 // Resume any requests which we had to defer until the PAC script was 1233 // Resume any requests which we had to defer until the PAC script was
1227 // downloaded. 1234 // downloaded.
1228 SetReady(); 1235 SetReady();
1229 } 1236 }
1230 1237
1231 int ProxyService::ReconsiderProxyAfterError(const GURL& url, 1238 int ProxyService::ReconsiderProxyAfterError(const GURL& url,
1239 const std::string& method,
1232 int load_flags, 1240 int load_flags,
1233 int net_error, 1241 int net_error,
1234 ProxyInfo* result, 1242 ProxyInfo* result,
1235 const CompletionCallback& callback, 1243 const CompletionCallback& callback,
1236 PacRequest** pac_request, 1244 PacRequest** pac_request,
1237 ProxyDelegate* proxy_delegate, 1245 ProxyDelegate* proxy_delegate,
1238 const BoundNetLog& net_log) { 1246 const BoundNetLog& net_log) {
1239 DCHECK(CalledOnValidThread()); 1247 DCHECK(CalledOnValidThread());
1240 1248
1241 // Check to see if we have a new config since ResolveProxy was called. We 1249 // Check to see if we have a new config since ResolveProxy was called. We
1242 // want to re-run ResolveProxy in two cases: 1) we have a new config, or 2) a 1250 // want to re-run ResolveProxy in two cases: 1) we have a new config, or 2) a
1243 // direct connection failed and we never tried the current config. 1251 // direct connection failed and we never tried the current config.
1244 1252
1245 DCHECK(result); 1253 DCHECK(result);
1246 bool re_resolve = result->config_id_ != config_.id(); 1254 bool re_resolve = result->config_id_ != config_.id();
1247 1255
1248 if (re_resolve) { 1256 if (re_resolve) {
1249 // If we have a new config or the config was never tried, we delete the 1257 // If we have a new config or the config was never tried, we delete the
1250 // list of bad proxies and we try again. 1258 // list of bad proxies and we try again.
1251 proxy_retry_info_.clear(); 1259 proxy_retry_info_.clear();
1252 return ResolveProxy(url, load_flags, result, callback, pac_request, 1260 return ResolveProxy(url, method, load_flags, result, callback, pac_request,
1253 proxy_delegate, net_log); 1261 proxy_delegate, net_log);
1254 } 1262 }
1255 1263
1256 DCHECK(!result->is_empty()); 1264 DCHECK(!result->is_empty());
1257 ProxyServer bad_proxy = result->proxy_server(); 1265 ProxyServer bad_proxy = result->proxy_server();
1258 1266
1259 // We don't have new proxy settings to try, try to fallback to the next proxy 1267 // We don't have new proxy settings to try, try to fallback to the next proxy
1260 // in the list. 1268 // in the list.
1261 bool did_fallback = result->Fallback(net_error, net_log); 1269 bool did_fallback = result->Fallback(net_error, net_log);
1262 1270
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 bool ProxyService::ContainsPendingRequest(PacRequest* req) { 1331 bool ProxyService::ContainsPendingRequest(PacRequest* req) {
1324 return pending_requests_.count(req) == 1; 1332 return pending_requests_.count(req) == 1;
1325 } 1333 }
1326 1334
1327 void ProxyService::RemovePendingRequest(PacRequest* req) { 1335 void ProxyService::RemovePendingRequest(PacRequest* req) {
1328 DCHECK(ContainsPendingRequest(req)); 1336 DCHECK(ContainsPendingRequest(req));
1329 pending_requests_.erase(req); 1337 pending_requests_.erase(req);
1330 } 1338 }
1331 1339
1332 int ProxyService::DidFinishResolvingProxy(const GURL& url, 1340 int ProxyService::DidFinishResolvingProxy(const GURL& url,
1341 const std::string& method,
1333 int load_flags, 1342 int load_flags,
1334 ProxyDelegate* proxy_delegate, 1343 ProxyDelegate* proxy_delegate,
1335 ProxyInfo* result, 1344 ProxyInfo* result,
1336 int result_code, 1345 int result_code,
1337 const BoundNetLog& net_log, 1346 const BoundNetLog& net_log,
1338 base::TimeTicks start_time, 1347 base::TimeTicks start_time,
1339 bool script_executed) { 1348 bool script_executed) {
1340 // Don't track any metrics if start_time is 0, which will happen when the user 1349 // Don't track any metrics if start_time is 0, which will happen when the user
1341 // calls |TryResolveProxySynchronously|. 1350 // calls |TryResolveProxySynchronously|.
1342 if (!start_time.is_null()) { 1351 if (!start_time.is_null()) {
1343 TimeDelta diff = TimeTicks::Now() - start_time; 1352 TimeDelta diff = TimeTicks::Now() - start_time;
1344 if (script_executed) { 1353 if (script_executed) {
1345 // This function "fixes" the result code, so make sure script terminated 1354 // This function "fixes" the result code, so make sure script terminated
1346 // errors are tracked. Only track result codes that were a result of 1355 // errors are tracked. Only track result codes that were a result of
1347 // script execution. 1356 // script execution.
1348 UMA_HISTOGRAM_BOOLEAN("Net.ProxyService.ScriptTerminated", 1357 UMA_HISTOGRAM_BOOLEAN("Net.ProxyService.ScriptTerminated",
1349 result_code == ERR_PAC_SCRIPT_TERMINATED); 1358 result_code == ERR_PAC_SCRIPT_TERMINATED);
1350 UMA_HISTOGRAM_CUSTOM_TIMES("Net.ProxyService.GetProxyUsingScriptTime", 1359 UMA_HISTOGRAM_CUSTOM_TIMES("Net.ProxyService.GetProxyUsingScriptTime",
1351 diff, base::TimeDelta::FromMicroseconds(100), 1360 diff, base::TimeDelta::FromMicroseconds(100),
1352 base::TimeDelta::FromSeconds(20), 50); 1361 base::TimeDelta::FromSeconds(20), 50);
1353 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ProxyService.GetProxyUsingScriptResult", 1362 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.ProxyService.GetProxyUsingScriptResult",
1354 std::abs(result_code)); 1363 std::abs(result_code));
1355 } 1364 }
1356 UMA_HISTOGRAM_BOOLEAN("Net.ProxyService.ResolvedUsingScript", 1365 UMA_HISTOGRAM_BOOLEAN("Net.ProxyService.ResolvedUsingScript",
1357 script_executed); 1366 script_executed);
1358 UMA_HISTOGRAM_CUSTOM_TIMES("Net.ProxyService.ResolveProxyTime", diff, 1367 UMA_HISTOGRAM_CUSTOM_TIMES("Net.ProxyService.ResolveProxyTime", diff,
1359 base::TimeDelta::FromMicroseconds(100), 1368 base::TimeDelta::FromMicroseconds(100),
1360 base::TimeDelta::FromSeconds(20), 50); 1369 base::TimeDelta::FromSeconds(20), 50);
1361 } 1370 }
1371
1362 // Log the result of the proxy resolution. 1372 // Log the result of the proxy resolution.
1363 if (result_code == OK) { 1373 if (result_code == OK) {
1364 // Allow the proxy delegate to interpose on the resolution decision, 1374 // Allow the proxy delegate to interpose on the resolution decision,
1365 // possibly modifying the ProxyInfo. 1375 // possibly modifying the ProxyInfo.
1366 if (proxy_delegate) 1376 if (proxy_delegate)
1367 proxy_delegate->OnResolveProxy(url, load_flags, *this, result); 1377 proxy_delegate->OnResolveProxy(url, method, load_flags, *this, result);
1368 1378
1369 net_log.AddEvent(NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST, 1379 net_log.AddEvent(NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST,
1370 base::Bind(&NetLogFinishedResolvingProxyCallback, result)); 1380 base::Bind(&NetLogFinishedResolvingProxyCallback, result));
1371 1381
1372 // This check is done to only log the NetLog event when necessary, it's 1382 // This check is done to only log the NetLog event when necessary, it's
1373 // not a performance optimization. 1383 // not a performance optimization.
1374 if (!proxy_retry_info_.empty()) { 1384 if (!proxy_retry_info_.empty()) {
1375 result->DeprioritizeBadProxies(proxy_retry_info_); 1385 result->DeprioritizeBadProxies(proxy_retry_info_);
1376 net_log.AddEvent( 1386 net_log.AddEvent(
1377 NetLog::TYPE_PROXY_SERVICE_DEPRIORITIZED_BAD_PROXIES, 1387 NetLog::TYPE_PROXY_SERVICE_DEPRIORITIZED_BAD_PROXIES,
(...skipping 11 matching lines...) Expand all
1389 // This implicit fall-back to direct matches Firefox 3.5 and 1399 // This implicit fall-back to direct matches Firefox 3.5 and
1390 // Internet Explorer 8. For more information, see: 1400 // Internet Explorer 8. For more information, see:
1391 // 1401 //
1392 // http://www.chromium.org/developers/design-documents/proxy-settings-fall back 1402 // http://www.chromium.org/developers/design-documents/proxy-settings-fall back
1393 result->UseDirect(); 1403 result->UseDirect();
1394 result_code = OK; 1404 result_code = OK;
1395 1405
1396 // Allow the proxy delegate to interpose on the resolution decision, 1406 // Allow the proxy delegate to interpose on the resolution decision,
1397 // possibly modifying the ProxyInfo. 1407 // possibly modifying the ProxyInfo.
1398 if (proxy_delegate) 1408 if (proxy_delegate)
1399 proxy_delegate->OnResolveProxy(url, load_flags, *this, result); 1409 proxy_delegate->OnResolveProxy(url, method, load_flags, *this, result);
1400 } else { 1410 } else {
1401 result_code = ERR_MANDATORY_PROXY_CONFIGURATION_FAILED; 1411 result_code = ERR_MANDATORY_PROXY_CONFIGURATION_FAILED;
1402 } 1412 }
1403 if (reset_config) { 1413 if (reset_config) {
1404 ResetProxyConfig(false); 1414 ResetProxyConfig(false);
1405 // If the ProxyResolver crashed, force it to be re-initialized for the 1415 // If the ProxyResolver crashed, force it to be re-initialized for the
1406 // next request by resetting the proxy config. If there are other pending 1416 // next request by resetting the proxy config. If there are other pending
1407 // requests, trigger the recreation immediately so those requests retry. 1417 // requests, trigger the recreation immediately so those requests retry.
1408 if (pending_requests_.size() > 1) 1418 if (pending_requests_.size() > 1)
1409 ApplyProxyConfigIfAvailable(); 1419 ApplyProxyConfigIfAvailable();
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 State previous_state = ResetProxyConfig(false); 1632 State previous_state = ResetProxyConfig(false);
1623 if (previous_state != STATE_NONE) 1633 if (previous_state != STATE_NONE)
1624 ApplyProxyConfigIfAvailable(); 1634 ApplyProxyConfigIfAvailable();
1625 } 1635 }
1626 1636
1627 void ProxyService::OnDNSChanged() { 1637 void ProxyService::OnDNSChanged() {
1628 OnIPAddressChanged(); 1638 OnIPAddressChanged();
1629 } 1639 }
1630 1640
1631 } // namespace net 1641 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698