| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 const HttpRequestInfo& request_info, | 108 const HttpRequestInfo& request_info, |
| 109 const SSLConfig& server_ssl_config, | 109 const SSLConfig& server_ssl_config, |
| 110 const SSLConfig& proxy_ssl_config, | 110 const SSLConfig& proxy_ssl_config, |
| 111 const BoundNetLog& net_log) | 111 const BoundNetLog& net_log) |
| 112 : request_(NULL), | 112 : request_(NULL), |
| 113 request_info_(request_info), | 113 request_info_(request_info), |
| 114 server_ssl_config_(server_ssl_config), | 114 server_ssl_config_(server_ssl_config), |
| 115 proxy_ssl_config_(proxy_ssl_config), | 115 proxy_ssl_config_(proxy_ssl_config), |
| 116 net_log_(BoundNetLog::Make(net_log.net_log(), | 116 net_log_(BoundNetLog::Make(net_log.net_log(), |
| 117 NetLog::SOURCE_HTTP_STREAM_JOB)), | 117 NetLog::SOURCE_HTTP_STREAM_JOB)), |
| 118 ALLOW_THIS_IN_INITIALIZER_LIST(old_io_callback_( | |
| 119 this, &Job::OnIOComplete)), | |
| 120 ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_( | 118 ALLOW_THIS_IN_INITIALIZER_LIST(io_callback_( |
| 121 base::Bind(&Job::OnIOComplete, base::Unretained(this)))), | 119 base::Bind(&Job::OnIOComplete, base::Unretained(this)))), |
| 122 connection_(new ClientSocketHandle), | 120 connection_(new ClientSocketHandle), |
| 123 session_(session), | 121 session_(session), |
| 124 stream_factory_(stream_factory), | 122 stream_factory_(stream_factory), |
| 125 next_state_(STATE_NONE), | 123 next_state_(STATE_NONE), |
| 126 pac_request_(NULL), | 124 pac_request_(NULL), |
| 127 blocking_job_(NULL), | 125 blocking_job_(NULL), |
| 128 dependent_job_(NULL), | 126 dependent_job_(NULL), |
| 129 using_ssl_(false), | 127 using_ssl_(false), |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 943 | 941 |
| 944 session_->proxy_service()->ReportSuccess(proxy_info_); | 942 session_->proxy_service()->ReportSuccess(proxy_info_); |
| 945 next_state_ = STATE_NONE; | 943 next_state_ = STATE_NONE; |
| 946 return OK; | 944 return OK; |
| 947 } | 945 } |
| 948 | 946 |
| 949 int HttpStreamFactoryImpl::Job::DoRestartTunnelAuth() { | 947 int HttpStreamFactoryImpl::Job::DoRestartTunnelAuth() { |
| 950 next_state_ = STATE_RESTART_TUNNEL_AUTH_COMPLETE; | 948 next_state_ = STATE_RESTART_TUNNEL_AUTH_COMPLETE; |
| 951 HttpProxyClientSocket* http_proxy_socket = | 949 HttpProxyClientSocket* http_proxy_socket = |
| 952 static_cast<HttpProxyClientSocket*>(connection_->socket()); | 950 static_cast<HttpProxyClientSocket*>(connection_->socket()); |
| 953 return http_proxy_socket->RestartWithAuth(&old_io_callback_); | 951 return http_proxy_socket->RestartWithAuth(io_callback_); |
| 954 } | 952 } |
| 955 | 953 |
| 956 int HttpStreamFactoryImpl::Job::DoRestartTunnelAuthComplete(int result) { | 954 int HttpStreamFactoryImpl::Job::DoRestartTunnelAuthComplete(int result) { |
| 957 if (result == ERR_PROXY_AUTH_REQUESTED) | 955 if (result == ERR_PROXY_AUTH_REQUESTED) |
| 958 return result; | 956 return result; |
| 959 | 957 |
| 960 if (result == OK) { | 958 if (result == OK) { |
| 961 // Now that we've got the HttpProxyClientSocket connected. We have | 959 // Now that we've got the HttpProxyClientSocket connected. We have |
| 962 // to release it as an idle socket into the pool and start the connection | 960 // to release it as an idle socket into the pool and start the connection |
| 963 // process from the beginning. Trying to pass it in with the | 961 // process from the beginning. Trying to pass it in with the |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 return false; | 1195 return false; |
| 1198 } | 1196 } |
| 1199 if (request_info_.method != "GET" && request_info_.method != "HEAD") { | 1197 if (request_info_.method != "GET" && request_info_.method != "HEAD") { |
| 1200 return false; | 1198 return false; |
| 1201 } | 1199 } |
| 1202 return stream_factory_->http_pipelined_host_pool_.IsHostEligibleForPipelining( | 1200 return stream_factory_->http_pipelined_host_pool_.IsHostEligibleForPipelining( |
| 1203 origin_); | 1201 origin_); |
| 1204 } | 1202 } |
| 1205 | 1203 |
| 1206 } // namespace net | 1204 } // namespace net |
| OLD | NEW |