| 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 20 matching lines...) Expand all Loading... |
| 31 #include "net/http/http_proxy_client_socket.h" | 31 #include "net/http/http_proxy_client_socket.h" |
| 32 #include "net/http/http_proxy_client_socket_pool.h" | 32 #include "net/http/http_proxy_client_socket_pool.h" |
| 33 #include "net/http/http_request_info.h" | 33 #include "net/http/http_request_info.h" |
| 34 #include "net/http/http_server_properties.h" | 34 #include "net/http/http_server_properties.h" |
| 35 #include "net/http/http_stream_factory.h" | 35 #include "net/http/http_stream_factory.h" |
| 36 #include "net/http/http_stream_factory_impl_request.h" | 36 #include "net/http/http_stream_factory_impl_request.h" |
| 37 #include "net/log/net_log_capture_mode.h" | 37 #include "net/log/net_log_capture_mode.h" |
| 38 #include "net/log/net_log_event_type.h" | 38 #include "net/log/net_log_event_type.h" |
| 39 #include "net/log/net_log_source.h" | 39 #include "net/log/net_log_source.h" |
| 40 #include "net/log/net_log_source_type.h" | 40 #include "net/log/net_log_source_type.h" |
| 41 #include "net/log/trace_constants.h" |
| 41 #include "net/quic/chromium/quic_http_stream.h" | 42 #include "net/quic/chromium/quic_http_stream.h" |
| 42 #include "net/socket/client_socket_handle.h" | 43 #include "net/socket/client_socket_handle.h" |
| 43 #include "net/socket/client_socket_pool.h" | 44 #include "net/socket/client_socket_pool.h" |
| 44 #include "net/socket/client_socket_pool_manager.h" | 45 #include "net/socket/client_socket_pool_manager.h" |
| 45 #include "net/socket/socks_client_socket_pool.h" | 46 #include "net/socket/socks_client_socket_pool.h" |
| 46 #include "net/socket/ssl_client_socket.h" | 47 #include "net/socket/ssl_client_socket.h" |
| 47 #include "net/socket/ssl_client_socket_pool.h" | 48 #include "net/socket/ssl_client_socket_pool.h" |
| 48 #include "net/spdy/bidirectional_stream_spdy_impl.h" | 49 #include "net/spdy/bidirectional_stream_spdy_impl.h" |
| 49 #include "net/spdy/spdy_http_stream.h" | 50 #include "net/spdy/spdy_http_stream.h" |
| 50 #include "net/spdy/spdy_protocol.h" | 51 #include "net/spdy/spdy_protocol.h" |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 // It is OK to dereference spdy_session_pool, because the | 494 // It is OK to dereference spdy_session_pool, because the |
| 494 // ClientSocketPoolManager will be destroyed in the same callback that | 495 // ClientSocketPoolManager will be destroyed in the same callback that |
| 495 // destroys the SpdySessionPool. | 496 // destroys the SpdySessionPool. |
| 496 return spdy_session_pool->FindAvailableSession(spdy_session_key, origin_url, | 497 return spdy_session_pool->FindAvailableSession(spdy_session_key, origin_url, |
| 497 net_log) | 498 net_log) |
| 498 ? ERR_SPDY_SESSION_ALREADY_EXISTS | 499 ? ERR_SPDY_SESSION_ALREADY_EXISTS |
| 499 : OK; | 500 : OK; |
| 500 } | 501 } |
| 501 | 502 |
| 502 void HttpStreamFactoryImpl::Job::OnIOComplete(int result) { | 503 void HttpStreamFactoryImpl::Job::OnIOComplete(int result) { |
| 503 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"), | 504 TRACE_EVENT0(kNetTracingCategory, "HttpStreamFactoryImpl::Job::OnIOComplete"); |
| 504 "HttpStreamFactoryImpl::Job::OnIOComplete"); | |
| 505 RunLoop(result); | 505 RunLoop(result); |
| 506 } | 506 } |
| 507 | 507 |
| 508 int HttpStreamFactoryImpl::Job::RunLoop(int result) { | 508 int HttpStreamFactoryImpl::Job::RunLoop(int result) { |
| 509 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("net"), | 509 TRACE_EVENT0(kNetTracingCategory, "HttpStreamFactoryImpl::Job::RunLoop"); |
| 510 "HttpStreamFactoryImpl::Job::RunLoop"); | |
| 511 result = DoLoop(result); | 510 result = DoLoop(result); |
| 512 | 511 |
| 513 if (result == ERR_IO_PENDING) | 512 if (result == ERR_IO_PENDING) |
| 514 return result; | 513 return result; |
| 515 | 514 |
| 516 if (job_type_ == PRECONNECT) { | 515 if (job_type_ == PRECONNECT) { |
| 517 base::ThreadTaskRunnerHandle::Get()->PostTask( | 516 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 518 FROM_HERE, | 517 FROM_HERE, |
| 519 base::Bind(&HttpStreamFactoryImpl::Job::OnPreconnectsComplete, | 518 base::Bind(&HttpStreamFactoryImpl::Job::OnPreconnectsComplete, |
| 520 ptr_factory_.GetWeakPtr())); | 519 ptr_factory_.GetWeakPtr())); |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1499 | 1498 |
| 1500 ConnectionAttempts socket_attempts = connection_->connection_attempts(); | 1499 ConnectionAttempts socket_attempts = connection_->connection_attempts(); |
| 1501 if (connection_->socket()) { | 1500 if (connection_->socket()) { |
| 1502 connection_->socket()->GetConnectionAttempts(&socket_attempts); | 1501 connection_->socket()->GetConnectionAttempts(&socket_attempts); |
| 1503 } | 1502 } |
| 1504 | 1503 |
| 1505 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); | 1504 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); |
| 1506 } | 1505 } |
| 1507 | 1506 |
| 1508 } // namespace net | 1507 } // namespace net |
| OLD | NEW |