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

Side by Side Diff: net/http/http_stream_factory_impl_request.cc

Issue 1006643002: Plumb connection attempts from (non-proxy) ConnectJobs to HttpNetworkTransaction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, resolve conflict Created 5 years, 7 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
« no previous file with comments | « net/http/http_stream_factory_impl_request.h ('k') | net/http/http_transaction.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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 ConnectionAttempts& HttpStreamFactoryImpl::Request::connection_attempts()
238 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
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 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
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
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_request.h ('k') | net/http/http_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698