Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_http_stream.h" | 5 #include "net/spdy/spdy_http_stream.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "net/base/address_list.h" | |
| 14 #include "net/base/host_port_pair.h" | |
| 13 #include "net/base/load_flags.h" | 15 #include "net/base/load_flags.h" |
| 14 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
| 15 #include "net/http/http_request_headers.h" | 17 #include "net/http/http_request_headers.h" |
| 16 #include "net/http/http_request_info.h" | 18 #include "net/http/http_request_info.h" |
| 17 #include "net/http/http_response_info.h" | 19 #include "net/http/http_response_info.h" |
| 18 #include "net/http/http_util.h" | 20 #include "net/http/http_util.h" |
| 19 #include "net/spdy/spdy_http_utils.h" | 21 #include "net/spdy/spdy_http_utils.h" |
| 20 #include "net/spdy/spdy_session.h" | 22 #include "net/spdy/spdy_session.h" |
| 21 | 23 |
| 22 namespace net { | 24 namespace net { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 // pushed. | 225 // pushed. |
| 224 if (push_response_info_.get()) { | 226 if (push_response_info_.get()) { |
| 225 *response = *(push_response_info_.get()); | 227 *response = *(push_response_info_.get()); |
| 226 push_response_info_.reset(); | 228 push_response_info_.reset(); |
| 227 } | 229 } |
| 228 else | 230 else |
| 229 DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_); | 231 DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_); |
| 230 | 232 |
| 231 response_info_ = response; | 233 response_info_ = response; |
| 232 | 234 |
| 235 // Put the peer's ip and port into the response. | |
|
eroman
2011/02/18 02:49:24
nit: "ip" --> "IP address" (my main nit is regardi
Brian Ryner
2011/02/18 04:41:59
Done.
| |
| 236 AddressList address; | |
| 237 int result = stream_->GetPeerAddress(&address); | |
| 238 if (result != OK) | |
| 239 return result; | |
| 240 response_info_->socket_address = HostPortPair::FromAddrInfo(address.head()); | |
| 241 | |
| 233 bool has_upload_data = request_body_stream_.get() != NULL; | 242 bool has_upload_data = request_body_stream_.get() != NULL; |
| 234 int result = stream_->SendRequest(has_upload_data); | 243 result = stream_->SendRequest(has_upload_data); |
| 235 if (result == ERR_IO_PENDING) { | 244 if (result == ERR_IO_PENDING) { |
| 236 CHECK(!user_callback_); | 245 CHECK(!user_callback_); |
| 237 user_callback_ = callback; | 246 user_callback_ = callback; |
| 238 } | 247 } |
| 239 return result; | 248 return result; |
| 240 } | 249 } |
| 241 | 250 |
| 242 void SpdyHttpStream::Cancel() { | 251 void SpdyHttpStream::Cancel() { |
| 243 if (spdy_session_) | 252 if (spdy_session_) |
| 244 spdy_session_->CancelPendingCreateStreams(&stream_); | 253 spdy_session_->CancelPendingCreateStreams(&stream_); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 stream_->GetSSLInfo(ssl_info, &using_npn); | 436 stream_->GetSSLInfo(ssl_info, &using_npn); |
| 428 } | 437 } |
| 429 | 438 |
| 430 void SpdyHttpStream::GetSSLCertRequestInfo( | 439 void SpdyHttpStream::GetSSLCertRequestInfo( |
| 431 SSLCertRequestInfo* cert_request_info) { | 440 SSLCertRequestInfo* cert_request_info) { |
| 432 DCHECK(stream_); | 441 DCHECK(stream_); |
| 433 stream_->GetSSLCertRequestInfo(cert_request_info); | 442 stream_->GetSSLCertRequestInfo(cert_request_info); |
| 434 } | 443 } |
| 435 | 444 |
| 436 } // namespace net | 445 } // namespace net |
| OLD | NEW |