| 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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 return session_->IsQuicEnabled() && | 771 return session_->IsQuicEnabled() && |
| 772 (base::ContainsKey(session_->params().origins_to_force_quic_on, | 772 (base::ContainsKey(session_->params().origins_to_force_quic_on, |
| 773 HostPortPair()) || | 773 HostPortPair()) || |
| 774 base::ContainsKey(session_->params().origins_to_force_quic_on, | 774 base::ContainsKey(session_->params().origins_to_force_quic_on, |
| 775 destination_)) && | 775 destination_)) && |
| 776 proxy_info_.is_direct() && origin_url_.SchemeIs(url::kHttpsScheme); | 776 proxy_info_.is_direct() && origin_url_.SchemeIs(url::kHttpsScheme); |
| 777 } | 777 } |
| 778 | 778 |
| 779 int HttpStreamFactoryImpl::Job::DoWait() { | 779 int HttpStreamFactoryImpl::Job::DoWait() { |
| 780 next_state_ = STATE_WAIT_COMPLETE; | 780 next_state_ = STATE_WAIT_COMPLETE; |
| 781 bool should_wait = delegate_->ShouldWait(this); | 781 if (delegate_->ShouldWait(this)) |
| 782 net_log_.BeginEvent(NetLogEventType::HTTP_STREAM_JOB_WAITING, | |
| 783 NetLog::BoolCallback("should_wait", should_wait)); | |
| 784 if (should_wait) | |
| 785 return ERR_IO_PENDING; | 782 return ERR_IO_PENDING; |
| 786 | 783 |
| 787 return OK; | 784 return OK; |
| 788 } | 785 } |
| 789 | 786 |
| 790 int HttpStreamFactoryImpl::Job::DoWaitComplete(int result) { | 787 int HttpStreamFactoryImpl::Job::DoWaitComplete(int result) { |
| 791 net_log_.EndEvent(NetLogEventType::HTTP_STREAM_JOB_WAITING); | |
| 792 DCHECK_EQ(OK, result); | 788 DCHECK_EQ(OK, result); |
| 793 next_state_ = STATE_INIT_CONNECTION; | 789 next_state_ = STATE_INIT_CONNECTION; |
| 794 return OK; | 790 return OK; |
| 795 } | 791 } |
| 796 | 792 |
| 797 int HttpStreamFactoryImpl::Job::DoInitConnection() { | 793 int HttpStreamFactoryImpl::Job::DoInitConnection() { |
| 798 int result = DoInitConnectionImpl(); | 794 int result = DoInitConnectionImpl(); |
| 799 if (result != ERR_SPDY_SESSION_ALREADY_EXISTS) | 795 if (result != ERR_SPDY_SESSION_ALREADY_EXISTS) |
| 800 delegate_->OnConnectionInitialized(this, result); | 796 delegate_->OnConnectionInitialized(this, result); |
| 801 | 797 |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 | 1505 |
| 1510 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1506 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
| 1511 if (connection_->socket()) { | 1507 if (connection_->socket()) { |
| 1512 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1508 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1513 } | 1509 } |
| 1514 | 1510 |
| 1515 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1511 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
| 1516 } | 1512 } |
| 1517 | 1513 |
| 1518 } // namespace net | 1514 } // namespace net |
| OLD | NEW |