| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/spdy/spdy_network_transaction.h" | 5 #include "net/spdy/spdy_network_transaction.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/stats_counters.h" | 10 #include "base/stats_counters.h" |
| 11 #include "net/base/host_resolver.h" | 11 #include "net/base/host_resolver.h" |
| 12 #include "net/base/io_buffer.h" | 12 #include "net/base/io_buffer.h" |
| 13 #include "net/base/load_flags.h" | 13 #include "net/base/load_flags.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 #include "net/base/net_util.h" | 15 #include "net/base/net_util.h" |
| 16 #include "net/base/upload_data_stream.h" | 16 #include "net/base/upload_data_stream.h" |
| 17 #include "net/http/http_network_session.h" | 17 #include "net/http/http_network_session.h" |
| 18 #include "net/http/http_request_info.h" | 18 #include "net/http/http_request_info.h" |
| 19 #include "net/http/http_response_info.h" | 19 #include "net/http/http_response_info.h" |
| 20 #include "net/socket/tcp_client_socket_pool.h" |
| 20 #include "net/spdy/spdy_stream.h" | 21 #include "net/spdy/spdy_stream.h" |
| 21 | 22 |
| 22 using base::Time; | 23 using base::Time; |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 | 26 |
| 26 //----------------------------------------------------------------------------- | 27 //----------------------------------------------------------------------------- |
| 27 | 28 |
| 28 SpdyNetworkTransaction::SpdyNetworkTransaction(HttpNetworkSession* session) | 29 SpdyNetworkTransaction::SpdyNetworkTransaction(HttpNetworkSession* session) |
| 29 : ALLOW_THIS_IN_INITIALIZER_LIST( | 30 : ALLOW_THIS_IN_INITIALIZER_LIST( |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 if (SpdySession::SSLMode()) { | 225 if (SpdySession::SSLMode()) { |
| 225 if (session_->fixed_https_port() != 0) | 226 if (session_->fixed_https_port() != 0) |
| 226 port = session_->fixed_https_port(); | 227 port = session_->fixed_https_port(); |
| 227 } else if (session_->fixed_http_port() != 0) { | 228 } else if (session_->fixed_http_port() != 0) { |
| 228 port = session_->fixed_http_port(); | 229 port = session_->fixed_http_port(); |
| 229 } | 230 } |
| 230 | 231 |
| 231 std::string connection_group = "spdy."; | 232 std::string connection_group = "spdy."; |
| 232 connection_group.append(host); | 233 connection_group.append(host); |
| 233 | 234 |
| 234 HostResolver::RequestInfo resolve_info(host, port); | 235 TCPSocketParams tcp_params(host, port, request_->priority, request_->referrer, |
| 236 false); |
| 235 HostPortPair host_port_pair(host, port); | 237 HostPortPair host_port_pair(host, port); |
| 236 | 238 |
| 237 spdy_ = session_->spdy_session_pool()->Get(host_port_pair, session_); | 239 spdy_ = session_->spdy_session_pool()->Get(host_port_pair, session_); |
| 238 DCHECK(spdy_); | 240 DCHECK(spdy_); |
| 239 | 241 |
| 240 return spdy_->Connect( | 242 return spdy_->Connect( |
| 241 connection_group, resolve_info, request_->priority, load_log_); | 243 connection_group, tcp_params, request_->priority, load_log_); |
| 242 } | 244 } |
| 243 | 245 |
| 244 int SpdyNetworkTransaction::DoInitConnectionComplete(int result) { | 246 int SpdyNetworkTransaction::DoInitConnectionComplete(int result) { |
| 245 if (result < 0) | 247 if (result < 0) |
| 246 return result; | 248 return result; |
| 247 | 249 |
| 248 next_state_ = STATE_SEND_REQUEST; | 250 next_state_ = STATE_SEND_REQUEST; |
| 249 return OK; | 251 return OK; |
| 250 } | 252 } |
| 251 | 253 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 user_buffer_ = NULL; | 291 user_buffer_ = NULL; |
| 290 user_buffer_len_ = 0; | 292 user_buffer_len_ = 0; |
| 291 | 293 |
| 292 if (result <= 0) | 294 if (result <= 0) |
| 293 stream_ = NULL; | 295 stream_ = NULL; |
| 294 | 296 |
| 295 return result; | 297 return result; |
| 296 } | 298 } |
| 297 | 299 |
| 298 } // namespace net | 300 } // namespace net |
| OLD | NEW |