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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 339 } |
340 | 340 |
341 void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() { | 341 void HttpStreamFactoryImpl::Job::OnNewSpdySessionReadyCallback() { |
342 DCHECK(stream_.get()); | 342 DCHECK(stream_.get()); |
343 DCHECK(!IsPreconnecting()); | 343 DCHECK(!IsPreconnecting()); |
344 DCHECK(using_spdy()); | 344 DCHECK(using_spdy()); |
345 // Note: an event loop iteration has passed, so |new_spdy_session_| may be | 345 // Note: an event loop iteration has passed, so |new_spdy_session_| may be |
346 // NULL at this point if the SpdySession closed immediately after creation. | 346 // NULL at this point if the SpdySession closed immediately after creation. |
347 base::WeakPtr<SpdySession> spdy_session = new_spdy_session_; | 347 base::WeakPtr<SpdySession> spdy_session = new_spdy_session_; |
348 new_spdy_session_.reset(); | 348 new_spdy_session_.reset(); |
| 349 |
| 350 // TODO(jgraettinger): Notify the factory, and let that notify |request_|, |
| 351 // rather than notifying |request_| directly. |
349 if (IsOrphaned()) { | 352 if (IsOrphaned()) { |
350 if (spdy_session) { | 353 if (spdy_session) { |
351 stream_factory_->OnNewSpdySessionReady( | 354 stream_factory_->OnNewSpdySessionReady( |
352 spdy_session, spdy_session_direct_, server_ssl_config_, proxy_info_, | 355 spdy_session, spdy_session_direct_, server_ssl_config_, proxy_info_, |
353 was_npn_negotiated(), protocol_negotiated(), using_spdy(), net_log_); | 356 was_npn_negotiated(), protocol_negotiated(), using_spdy(), net_log_); |
354 } | 357 } |
355 stream_factory_->OnOrphanedJobComplete(this); | 358 stream_factory_->OnOrphanedJobComplete(this); |
356 } else { | 359 } else { |
357 request_->OnNewSpdySessionReady( | 360 request_->OnNewSpdySessionReady( |
358 this, stream_.Pass(), spdy_session, spdy_session_direct_); | 361 this, stream_.Pass(), spdy_session, spdy_session_direct_); |
(...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 | 1541 |
1539 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { | 1542 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { |
1540 HistogramBrokenAlternateProtocolLocation( | 1543 HistogramBrokenAlternateProtocolLocation( |
1541 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); | 1544 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); |
1542 session_->http_server_properties()->SetBrokenAlternateProtocol( | 1545 session_->http_server_properties()->SetBrokenAlternateProtocol( |
1543 HostPortPair::FromURL(request_info_.url)); | 1546 HostPortPair::FromURL(request_info_.url)); |
1544 } | 1547 } |
1545 } | 1548 } |
1546 | 1549 |
1547 } // namespace net | 1550 } // namespace net |
OLD | NEW |