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/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 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 if (push_response_info_.get()) { | 243 if (push_response_info_.get()) { |
244 *response = *(push_response_info_.get()); | 244 *response = *(push_response_info_.get()); |
245 push_response_info_.reset(); | 245 push_response_info_.reset(); |
246 } | 246 } |
247 else | 247 else |
248 DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_); | 248 DCHECK_EQ(static_cast<HttpResponseInfo*>(NULL), response_info_); |
249 | 249 |
250 response_info_ = response; | 250 response_info_ = response; |
251 | 251 |
252 // Put the peer's IP address and port into the response. | 252 // Put the peer's IP address and port into the response. |
253 AddressList address; | 253 IPEndPoint address; |
254 int result = stream_->GetPeerAddress(&address); | 254 int result = stream_->GetPeerAddress(&address); |
255 if (result != OK) | 255 if (result != OK) |
256 return result; | 256 return result; |
257 response_info_->socket_address = | 257 response_info_->socket_address = HostPortPair::FromIPEndPoint(address); |
258 HostPortPair::FromIPEndPoint(address.front()); | |
259 | 258 |
260 bool has_upload_data = request_body_stream_.get() != NULL; | 259 bool has_upload_data = request_body_stream_.get() != NULL; |
261 result = stream_->SendRequest(has_upload_data); | 260 result = stream_->SendRequest(has_upload_data); |
262 if (result == ERR_IO_PENDING) { | 261 if (result == ERR_IO_PENDING) { |
263 CHECK(callback_.is_null()); | 262 CHECK(callback_.is_null()); |
264 callback_ = callback; | 263 callback_ = callback; |
265 } | 264 } |
266 return result; | 265 return result; |
267 } | 266 } |
268 | 267 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 bool SpdyHttpStream::IsSpdyHttpStream() const { | 506 bool SpdyHttpStream::IsSpdyHttpStream() const { |
508 return true; | 507 return true; |
509 } | 508 } |
510 | 509 |
511 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 510 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
512 Close(false); | 511 Close(false); |
513 delete this; | 512 delete this; |
514 } | 513 } |
515 | 514 |
516 } // namespace net | 515 } // namespace net |
OLD | NEW |