| 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 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 } | 842 } |
| 843 | 843 |
| 844 int HttpStreamFactoryImpl::Job::DoWaitComplete(int result) { | 844 int HttpStreamFactoryImpl::Job::DoWaitComplete(int result) { |
| 845 net_log_.EndEvent(NetLogEventType::HTTP_STREAM_JOB_WAITING); | 845 net_log_.EndEvent(NetLogEventType::HTTP_STREAM_JOB_WAITING); |
| 846 DCHECK_EQ(OK, result); | 846 DCHECK_EQ(OK, result); |
| 847 next_state_ = STATE_INIT_CONNECTION; | 847 next_state_ = STATE_INIT_CONNECTION; |
| 848 return OK; | 848 return OK; |
| 849 } | 849 } |
| 850 | 850 |
| 851 int HttpStreamFactoryImpl::Job::DoInitConnection() { | 851 int HttpStreamFactoryImpl::Job::DoInitConnection() { |
| 852 net_log_.BeginEvent(NetLogEventType::HTTP_STREAM_JOB_INIT_CONNECTION); |
| 852 int result = DoInitConnectionImpl(); | 853 int result = DoInitConnectionImpl(); |
| 853 if (result != ERR_SPDY_SESSION_ALREADY_EXISTS) | 854 if (result != ERR_SPDY_SESSION_ALREADY_EXISTS) |
| 854 delegate_->OnConnectionInitialized(this, result); | 855 delegate_->OnConnectionInitialized(this, result); |
| 855 | 856 |
| 856 return result; | 857 return result; |
| 857 } | 858 } |
| 858 | 859 |
| 859 int HttpStreamFactoryImpl::Job::DoInitConnectionImpl() { | 860 int HttpStreamFactoryImpl::Job::DoInitConnectionImpl() { |
| 860 // TODO(pkasting): Remove ScopedTracker below once crbug.com/462812 is fixed. | 861 // TODO(pkasting): Remove ScopedTracker below once crbug.com/462812 is fixed. |
| 861 tracked_objects::ScopedTracker tracking_profile( | 862 tracked_objects::ScopedTracker tracking_profile( |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 } | 1017 } |
| 1017 | 1018 |
| 1018 return InitSocketHandleForHttpRequest( | 1019 return InitSocketHandleForHttpRequest( |
| 1019 GetSocketGroup(), destination_, request_info_.extra_headers, | 1020 GetSocketGroup(), destination_, request_info_.extra_headers, |
| 1020 request_info_.load_flags, priority_, session_, proxy_info_, expect_spdy, | 1021 request_info_.load_flags, priority_, session_, proxy_info_, expect_spdy, |
| 1021 server_ssl_config_, proxy_ssl_config_, request_info_.privacy_mode, | 1022 server_ssl_config_, proxy_ssl_config_, request_info_.privacy_mode, |
| 1022 net_log_, connection_.get(), resolution_callback, io_callback_); | 1023 net_log_, connection_.get(), resolution_callback, io_callback_); |
| 1023 } | 1024 } |
| 1024 | 1025 |
| 1025 int HttpStreamFactoryImpl::Job::DoInitConnectionComplete(int result) { | 1026 int HttpStreamFactoryImpl::Job::DoInitConnectionComplete(int result) { |
| 1027 net_log_.EndEvent(NetLogEventType::HTTP_STREAM_JOB_INIT_CONNECTION); |
| 1026 if (job_type_ == PRECONNECT) { | 1028 if (job_type_ == PRECONNECT) { |
| 1027 if (using_quic_) | 1029 if (using_quic_) |
| 1028 return result; | 1030 return result; |
| 1029 DCHECK_EQ(OK, result); | 1031 DCHECK_EQ(OK, result); |
| 1030 return OK; | 1032 return OK; |
| 1031 } | 1033 } |
| 1032 | 1034 |
| 1033 if (result == ERR_SPDY_SESSION_ALREADY_EXISTS) { | 1035 if (result == ERR_SPDY_SESSION_ALREADY_EXISTS) { |
| 1034 // We found a SPDY connection after resolving the host. This is | 1036 // We found a SPDY connection after resolving the host. This is |
| 1035 // probably an IP pooled connection. | 1037 // probably an IP pooled connection. |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 | 1562 |
| 1561 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1563 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
| 1562 if (connection_->socket()) { | 1564 if (connection_->socket()) { |
| 1563 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1565 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1564 } | 1566 } |
| 1565 | 1567 |
| 1566 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1568 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
| 1567 } | 1569 } |
| 1568 | 1570 |
| 1569 } // namespace net | 1571 } // namespace net |
| OLD | NEW |