| 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 #include "net/http/http_stream_factory_impl_job.h" | 5 #include "net/http/http_stream_factory_impl_job.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } | 645 } |
| 646 return ERR_UNSAFE_PORT; | 646 return ERR_UNSAFE_PORT; |
| 647 } | 647 } |
| 648 | 648 |
| 649 next_state_ = STATE_RESOLVE_PROXY; | 649 next_state_ = STATE_RESOLVE_PROXY; |
| 650 return OK; | 650 return OK; |
| 651 } | 651 } |
| 652 | 652 |
| 653 int HttpStreamFactoryImpl::Job::DoResolveProxy() { | 653 int HttpStreamFactoryImpl::Job::DoResolveProxy() { |
| 654 DCHECK(!pac_request_); | 654 DCHECK(!pac_request_); |
| 655 DCHECK(session_); |
| 655 | 656 |
| 656 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; | 657 next_state_ = STATE_RESOLVE_PROXY_COMPLETE; |
| 657 | 658 |
| 658 if (request_info_.load_flags & LOAD_BYPASS_PROXY) { | 659 if (request_info_.load_flags & LOAD_BYPASS_PROXY) { |
| 659 proxy_info_.UseDirect(); | 660 proxy_info_.UseDirect(); |
| 660 return OK; | 661 return OK; |
| 661 } | 662 } |
| 662 | 663 |
| 663 return session_->proxy_service()->ResolveProxy( | 664 return session_->proxy_service()->ResolveProxy( |
| 664 request_info_.url, &proxy_info_, io_callback_, &pac_request_, net_log_); | 665 request_info_.url, request_info_.load_flags, &proxy_info_, io_callback_, |
| 666 &pac_request_, session_->network_delegate(), net_log_); |
| 665 } | 667 } |
| 666 | 668 |
| 667 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) { | 669 int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) { |
| 668 pac_request_ = NULL; | 670 pac_request_ = NULL; |
| 669 | 671 |
| 670 if (result == OK) { | 672 if (result == OK) { |
| 671 // Remove unsupported proxies from the list. | 673 // Remove unsupported proxies from the list. |
| 672 proxy_info_.RemoveProxiesWithoutScheme( | 674 proxy_info_.RemoveProxiesWithoutScheme( |
| 673 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_QUIC | | 675 ProxyServer::SCHEME_DIRECT | ProxyServer::SCHEME_QUIC | |
| 674 ProxyServer::SCHEME_HTTP | ProxyServer::SCHEME_HTTPS | | 676 ProxyServer::SCHEME_HTTP | ProxyServer::SCHEME_HTTPS | |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1473 | 1475 |
| 1474 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1476 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
| 1475 HistogramBrokenAlternateProtocolLocation( | 1477 HistogramBrokenAlternateProtocolLocation( |
| 1476 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1478 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
| 1477 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1479 session_->http_server_properties()->SetBrokenAlternateProtocol( |
| 1478 HostPortPair::FromURL(request_info_.url)); | 1480 HostPortPair::FromURL(request_info_.url)); |
| 1479 } | 1481 } |
| 1480 } | 1482 } |
| 1481 | 1483 |
| 1482 } // namespace net | 1484 } // namespace net |
| OLD | NEW |