| 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_request.h" | 5 #include "net/http/http_stream_factory_impl_request.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "net/http/http_stream_factory_impl_job.h" | 10 #include "net/http/http_stream_factory_impl_job.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 delegate_->OnHttpsProxyTunnelResponse( | 208 delegate_->OnHttpsProxyTunnelResponse( |
| 209 response_info, used_ssl_config, used_proxy_info, stream); | 209 response_info, used_ssl_config, used_proxy_info, stream); |
| 210 } | 210 } |
| 211 | 211 |
| 212 int HttpStreamFactoryImpl::Request::RestartTunnelWithProxyAuth( | 212 int HttpStreamFactoryImpl::Request::RestartTunnelWithProxyAuth( |
| 213 const AuthCredentials& credentials) { | 213 const AuthCredentials& credentials) { |
| 214 DCHECK(bound_job_.get()); | 214 DCHECK(bound_job_.get()); |
| 215 return bound_job_->RestartTunnelWithProxyAuth(credentials); | 215 return bound_job_->RestartTunnelWithProxyAuth(credentials); |
| 216 } | 216 } |
| 217 | 217 |
| 218 void HttpStreamFactoryImpl::Request::SetPriority(RequestPriority priority) { |
| 219 for (std::set<HttpStreamFactoryImpl::Job*>::const_iterator it = jobs_.begin(); |
| 220 it != jobs_.end(); ++it) { |
| 221 (*it)->SetPriority(priority); |
| 222 } |
| 223 if (bound_job_) |
| 224 bound_job_->SetPriority(priority); |
| 225 } |
| 226 |
| 218 LoadState HttpStreamFactoryImpl::Request::GetLoadState() const { | 227 LoadState HttpStreamFactoryImpl::Request::GetLoadState() const { |
| 219 if (bound_job_.get()) | 228 if (bound_job_.get()) |
| 220 return bound_job_->GetLoadState(); | 229 return bound_job_->GetLoadState(); |
| 221 DCHECK(!jobs_.empty()); | 230 DCHECK(!jobs_.empty()); |
| 222 | 231 |
| 223 // Just pick the first one. | 232 // Just pick the first one. |
| 224 return (*jobs_.begin())->GetLoadState(); | 233 return (*jobs_.begin())->GetLoadState(); |
| 225 } | 234 } |
| 226 | 235 |
| 227 bool HttpStreamFactoryImpl::Request::was_npn_negotiated() const { | 236 bool HttpStreamFactoryImpl::Request::was_npn_negotiated() const { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } else if (!bound_job_.get()) { | 380 } else if (!bound_job_.get()) { |
| 372 // We may have other jobs in |jobs_|. For example, if we start multiple jobs | 381 // We may have other jobs in |jobs_|. For example, if we start multiple jobs |
| 373 // for Alternate-Protocol. | 382 // for Alternate-Protocol. |
| 374 OrphanJobsExcept(job); | 383 OrphanJobsExcept(job); |
| 375 } else { | 384 } else { |
| 376 DCHECK(jobs_.empty()); | 385 DCHECK(jobs_.empty()); |
| 377 } | 386 } |
| 378 } | 387 } |
| 379 | 388 |
| 380 } // namespace net | 389 } // namespace net |
| OLD | NEW |