OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 if (buffered_read_callback_pending_) { | 391 if (buffered_read_callback_pending_) { |
392 more_read_data_pending_ = true; | 392 more_read_data_pending_ = true; |
393 return; | 393 return; |
394 } | 394 } |
395 | 395 |
396 more_read_data_pending_ = false; | 396 more_read_data_pending_ = false; |
397 buffered_read_callback_pending_ = true; | 397 buffered_read_callback_pending_ = true; |
398 const int kBufferTimeMs = 1; | 398 const int kBufferTimeMs = 1; |
399 MessageLoop::current()->PostDelayedTask( | 399 MessageLoop::current()->PostDelayedTask( |
400 FROM_HERE, | 400 FROM_HERE, |
401 base::Bind(&SpdyHttpStream::DoBufferedReadCallback, | 401 base::Bind(base::IgnoreResult(&SpdyHttpStream::DoBufferedReadCallback), |
402 weak_factory_.GetWeakPtr()), | 402 weak_factory_.GetWeakPtr()), |
403 kBufferTimeMs); | 403 kBufferTimeMs); |
404 } | 404 } |
405 | 405 |
406 // Checks to see if we should wait for more buffered data before notifying | 406 // Checks to see if we should wait for more buffered data before notifying |
407 // the caller. Returns true if we should wait, false otherwise. | 407 // the caller. Returns true if we should wait, false otherwise. |
408 bool SpdyHttpStream::ShouldWaitForMoreBufferedData() const { | 408 bool SpdyHttpStream::ShouldWaitForMoreBufferedData() const { |
409 // If the response is complete, there is no point in waiting. | 409 // If the response is complete, there is no point in waiting. |
410 if (stream_->closed()) | 410 if (stream_->closed()) |
411 return false; | 411 return false; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 bool SpdyHttpStream::IsSpdyHttpStream() const { | 474 bool SpdyHttpStream::IsSpdyHttpStream() const { |
475 return true; | 475 return true; |
476 } | 476 } |
477 | 477 |
478 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 478 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
479 Close(false); | 479 Close(false); |
480 delete this; | 480 delete this; |
481 } | 481 } |
482 | 482 |
483 } // namespace net | 483 } // namespace net |
OLD | NEW |