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 = |
258 HostPortPair::FromIPEndPoint(address.front()); | 258 HostPortPair::FromIPEndPoint(address); |
szym
2012/06/07 02:42:47
I think this now fits on one line.
| |
259 | 259 |
260 bool has_upload_data = request_body_stream_.get() != NULL; | 260 bool has_upload_data = request_body_stream_.get() != NULL; |
261 result = stream_->SendRequest(has_upload_data); | 261 result = stream_->SendRequest(has_upload_data); |
262 if (result == ERR_IO_PENDING) { | 262 if (result == ERR_IO_PENDING) { |
263 CHECK(callback_.is_null()); | 263 CHECK(callback_.is_null()); |
264 callback_ = callback; | 264 callback_ = callback; |
265 } | 265 } |
266 return result; | 266 return result; |
267 } | 267 } |
268 | 268 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 bool SpdyHttpStream::IsSpdyHttpStream() const { | 507 bool SpdyHttpStream::IsSpdyHttpStream() const { |
508 return true; | 508 return true; |
509 } | 509 } |
510 | 510 |
511 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 511 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
512 Close(false); | 512 Close(false); |
513 delete this; | 513 delete this; |
514 } | 514 } |
515 | 515 |
516 } // namespace net | 516 } // namespace net |
OLD | NEW |