| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 const { | 227 const { |
| 228 DCHECK(completed_); | 228 DCHECK(completed_); |
| 229 return protocol_negotiated_; | 229 return protocol_negotiated_; |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool HttpStreamFactoryImpl::Request::using_spdy() const { | 232 bool HttpStreamFactoryImpl::Request::using_spdy() const { |
| 233 DCHECK(completed_); | 233 DCHECK(completed_); |
| 234 return using_spdy_; | 234 return using_spdy_; |
| 235 } | 235 } |
| 236 | 236 |
| 237 const ClientSocketHandle::ConnectionAttempts& |
| 238 HttpStreamFactoryImpl::Request::connection_attempts() const { |
| 239 return connection_attempts_; |
| 240 } |
| 241 |
| 237 void | 242 void |
| 238 HttpStreamFactoryImpl::Request::RemoveRequestFromSpdySessionRequestMap() { | 243 HttpStreamFactoryImpl::Request::RemoveRequestFromSpdySessionRequestMap() { |
| 239 if (spdy_session_key_.get()) { | 244 if (spdy_session_key_.get()) { |
| 240 SpdySessionRequestMap& spdy_session_request_map = | 245 SpdySessionRequestMap& spdy_session_request_map = |
| 241 factory_->spdy_session_request_map_; | 246 factory_->spdy_session_request_map_; |
| 242 DCHECK(ContainsKey(spdy_session_request_map, *spdy_session_key_)); | 247 DCHECK(ContainsKey(spdy_session_request_map, *spdy_session_key_)); |
| 243 RequestSet& request_set = | 248 RequestSet& request_set = |
| 244 spdy_session_request_map[*spdy_session_key_]; | 249 spdy_session_request_map[*spdy_session_key_]; |
| 245 DCHECK(ContainsKey(request_set, this)); | 250 DCHECK(ContainsKey(request_set, this)); |
| 246 request_set.erase(this); | 251 request_set.erase(this); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 direct, | 313 direct, |
| 309 used_ssl_config, | 314 used_ssl_config, |
| 310 used_proxy_info, | 315 used_proxy_info, |
| 311 was_npn_negotiated, | 316 was_npn_negotiated, |
| 312 protocol_negotiated, | 317 protocol_negotiated, |
| 313 using_spdy, | 318 using_spdy, |
| 314 net_log); | 319 net_log); |
| 315 } | 320 } |
| 316 } | 321 } |
| 317 | 322 |
| 323 void HttpStreamFactoryImpl::Request::AddConnectionAttempts( |
| 324 const ClientSocketHandle::ConnectionAttempts& attempts) { |
| 325 for (const auto& attempt : attempts) |
| 326 connection_attempts_.push_back(attempt); |
| 327 } |
| 328 |
| 318 void HttpStreamFactoryImpl::Request::OrphanJobsExcept(Job* job) { | 329 void HttpStreamFactoryImpl::Request::OrphanJobsExcept(Job* job) { |
| 319 DCHECK(job); | 330 DCHECK(job); |
| 320 DCHECK(!bound_job_.get()); | 331 DCHECK(!bound_job_.get()); |
| 321 DCHECK(ContainsKey(jobs_, job)); | 332 DCHECK(ContainsKey(jobs_, job)); |
| 322 bound_job_.reset(job); | 333 bound_job_.reset(job); |
| 323 jobs_.erase(job); | 334 jobs_.erase(job); |
| 324 factory_->request_map_.erase(job); | 335 factory_->request_map_.erase(job); |
| 325 | 336 |
| 326 OrphanJobs(); | 337 OrphanJobs(); |
| 327 } | 338 } |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 374 } |
| 364 // We may have other jobs in |jobs_|. For example, if we start multiple jobs | 375 // We may have other jobs in |jobs_|. For example, if we start multiple jobs |
| 365 // for Alternate-Protocol. | 376 // for Alternate-Protocol. |
| 366 OrphanJobsExcept(job); | 377 OrphanJobsExcept(job); |
| 367 return; | 378 return; |
| 368 } | 379 } |
| 369 DCHECK(jobs_.empty()); | 380 DCHECK(jobs_.empty()); |
| 370 } | 381 } |
| 371 | 382 |
| 372 } // namespace net | 383 } // namespace net |
| OLD | NEW |