| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 callback_.Reset(); | 276 callback_.Reset(); |
| 277 if (stream_) | 277 if (stream_) |
| 278 stream_->Cancel(); | 278 stream_->Cancel(); |
| 279 } | 279 } |
| 280 | 280 |
| 281 int SpdyHttpStream::SendData() { | 281 int SpdyHttpStream::SendData() { |
| 282 CHECK(request_body_stream_.get()); | 282 CHECK(request_body_stream_.get()); |
| 283 CHECK_EQ(0, request_body_buf_->BytesRemaining()); | 283 CHECK_EQ(0, request_body_buf_->BytesRemaining()); |
| 284 | 284 |
| 285 // Read the data from the request body stream. | 285 // Read the data from the request body stream. |
| 286 const int bytes_read = request_body_stream_->Read( | 286 const int bytes_read = request_body_stream_->ReadSync( |
| 287 raw_request_body_buf_, raw_request_body_buf_->size()); | 287 raw_request_body_buf_, raw_request_body_buf_->size()); |
| 288 DCHECK(!waiting_for_chunk_ || bytes_read != ERR_IO_PENDING); | 288 DCHECK(!waiting_for_chunk_ || bytes_read != ERR_IO_PENDING); |
| 289 | 289 |
| 290 if (request_body_stream_->is_chunked() && bytes_read == ERR_IO_PENDING) { | 290 if (request_body_stream_->is_chunked() && bytes_read == ERR_IO_PENDING) { |
| 291 waiting_for_chunk_ = true; | 291 waiting_for_chunk_ = true; |
| 292 return ERR_IO_PENDING; | 292 return ERR_IO_PENDING; |
| 293 } | 293 } |
| 294 | 294 |
| 295 waiting_for_chunk_ = false; | 295 waiting_for_chunk_ = false; |
| 296 | 296 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 bool SpdyHttpStream::IsSpdyHttpStream() const { | 542 bool SpdyHttpStream::IsSpdyHttpStream() const { |
| 543 return true; | 543 return true; |
| 544 } | 544 } |
| 545 | 545 |
| 546 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 546 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
| 547 Close(false); | 547 Close(false); |
| 548 delete this; | 548 delete this; |
| 549 } | 549 } |
| 550 | 550 |
| 551 } // namespace net | 551 } // namespace net |
| OLD | NEW |