| 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 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 if (stream_) { | 285 if (stream_) { |
| 286 stream_->Cancel(); | 286 stream_->Cancel(); |
| 287 DCHECK(!stream_); | 287 DCHECK(!stream_); |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 void SpdyHttpStream::OnRequestHeadersSent() { | 291 void SpdyHttpStream::OnRequestHeadersSent() { |
| 292 if (!callback_.is_null()) | 292 if (!callback_.is_null()) |
| 293 DoCallback(OK); | 293 DoCallback(OK); |
| 294 | 294 |
| 295 // TODO(akalin): Do this immediately after sending the request |
| 296 // headers. |
| 295 if (HasUploadData()) | 297 if (HasUploadData()) |
| 296 ReadAndSendRequestBodyData(); | 298 ReadAndSendRequestBodyData(); |
| 297 } | 299 } |
| 298 | 300 |
| 299 int SpdyHttpStream::OnResponseHeadersReceived(const SpdyHeaderBlock& response, | 301 int SpdyHttpStream::OnResponseHeadersReceived(const SpdyHeaderBlock& response, |
| 300 base::Time response_time, | 302 base::Time response_time, |
| 301 int status) { | 303 int status) { |
| 302 if (!response_info_) { | 304 if (!response_info_) { |
| 303 DCHECK_EQ(stream_->type(), SPDY_PUSH_STREAM); | 305 DCHECK_EQ(stream_->type(), SPDY_PUSH_STREAM); |
| 304 push_response_info_.reset(new HttpResponseInfo); | 306 push_response_info_.reset(new HttpResponseInfo); |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 bool SpdyHttpStream::IsSpdyHttpStream() const { | 545 bool SpdyHttpStream::IsSpdyHttpStream() const { |
| 544 return true; | 546 return true; |
| 545 } | 547 } |
| 546 | 548 |
| 547 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 549 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
| 548 Close(false); | 550 Close(false); |
| 549 delete this; | 551 delete this; |
| 550 } | 552 } |
| 551 | 553 |
| 552 } // namespace net | 554 } // namespace net |
| OLD | NEW |