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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 } | 332 } |
333 | 333 |
334 void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() { | 334 void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() { |
335 DCHECK(stream_.get()); | 335 DCHECK(stream_.get()); |
336 DCHECK(!IsPreconnecting()); | 336 DCHECK(!IsPreconnecting()); |
337 DCHECK(using_spdy()); | 337 DCHECK(using_spdy()); |
338 // Note: an event loop iteration has passed, so |new_spdy_session_| may be | 338 // Note: an event loop iteration has passed, so |new_spdy_session_| may be |
339 // NULL at this point if the SpdySession closed immediately after creation. | 339 // NULL at this point if the SpdySession closed immediately after creation. |
340 base::WeakPtr<SpdySession> spdy_session = new_spdy_session_; | 340 base::WeakPtr<SpdySession> spdy_session = new_spdy_session_; |
341 new_spdy_session_.reset(); | 341 new_spdy_session_.reset(); |
342 | |
343 // TODO(jgraettinger): Notify the factory, and let that notify |request_|, | |
344 // rather than notifying |request_| directly. | |
345 if (IsOrphaned()) { | 342 if (IsOrphaned()) { |
346 if (spdy_session) { | 343 if (spdy_session) { |
347 stream_factory_->OnNewSpdySessionReady( | 344 stream_factory_->OnNewSpdySessionReady( |
348 spdy_session, spdy_session_direct_, server_ssl_config_, proxy_info_, | 345 spdy_session, spdy_session_direct_, server_ssl_config_, proxy_info_, |
349 was_npn_negotiated(), protocol_negotiated(), using_spdy(), net_log_); | 346 was_npn_negotiated(), protocol_negotiated(), using_spdy(), net_log_); |
350 } | 347 } |
351 stream_factory_->OnOrphanedJobComplete(this); | 348 stream_factory_->OnOrphanedJobComplete(this); |
352 } else { | 349 } else { |
353 request_->OnNewSpdySessionReady( | 350 request_->OnNewSpdySessionReady( |
354 this, stream_.Pass(), spdy_session, spdy_session_direct_); | 351 this, stream_.Pass(), spdy_session, spdy_session_direct_); |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 | 1466 |
1470 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1467 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
1471 HistogramBrokenAlternateProtocolLocation( | 1468 HistogramBrokenAlternateProtocolLocation( |
1472 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1469 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
1473 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1470 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1474 HostPortPair::FromURL(request_info_.url)); | 1471 HostPortPair::FromURL(request_info_.url)); |
1475 } | 1472 } |
1476 } | 1473 } |
1477 | 1474 |
1478 } // namespace net | 1475 } // namespace net |
OLD | NEW |