| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 // TODO(ahendrickson): This is recorded after the entire SYN_STREAM control | 361 // TODO(ahendrickson): This is recorded after the entire SYN_STREAM control |
| 362 // frame has been received and processed. Move to framer? | 362 // frame has been received and processed. Move to framer? |
| 363 response_info_->response_time = response_time; | 363 response_info_->response_time = response_time; |
| 364 | 364 |
| 365 if (!callback_.is_null()) | 365 if (!callback_.is_null()) |
| 366 DoCallback(status); | 366 DoCallback(status); |
| 367 | 367 |
| 368 return status; | 368 return status; |
| 369 } | 369 } |
| 370 | 370 |
| 371 void SpdyHttpStream::OnHeadersSent() { | |
| 372 // For HTTP streams, no HEADERS frame is sent from the client. | |
| 373 NOTREACHED(); | |
| 374 } | |
| 375 | |
| 376 int SpdyHttpStream::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) { | 371 int SpdyHttpStream::OnDataReceived(scoped_ptr<SpdyBuffer> buffer) { |
| 377 // SpdyStream won't call us with data if the header block didn't contain a | 372 // SpdyStream won't call us with data if the header block didn't contain a |
| 378 // valid set of headers. So we don't expect to not have headers received | 373 // valid set of headers. So we don't expect to not have headers received |
| 379 // here. | 374 // here. |
| 380 if (!response_headers_received_) | 375 if (!response_headers_received_) |
| 381 return ERR_INCOMPLETE_SPDY_HEADERS; | 376 return ERR_INCOMPLETE_SPDY_HEADERS; |
| 382 | 377 |
| 383 // Note that data may be received for a SpdyStream prior to the user calling | 378 // Note that data may be received for a SpdyStream prior to the user calling |
| 384 // ReadResponseBody(), therefore user_buffer_ may be NULL. This may often | 379 // ReadResponseBody(), therefore user_buffer_ may be NULL. This may often |
| 385 // happen for server initiated streams. | 380 // happen for server initiated streams. |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 bool SpdyHttpStream::IsSpdyHttpStream() const { | 550 bool SpdyHttpStream::IsSpdyHttpStream() const { |
| 556 return true; | 551 return true; |
| 557 } | 552 } |
| 558 | 553 |
| 559 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 554 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
| 560 Close(false); | 555 Close(false); |
| 561 delete this; | 556 delete this; |
| 562 } | 557 } |
| 563 | 558 |
| 564 } // namespace net | 559 } // namespace net |
| OLD | NEW |