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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 } else { | 121 } else { |
122 const int bytes_remaining = data->size() - bytes_to_copy; | 122 const int bytes_remaining = data->size() - bytes_to_copy; |
123 IOBufferWithSize* new_buffer = new IOBufferWithSize(bytes_remaining); | 123 IOBufferWithSize* new_buffer = new IOBufferWithSize(bytes_remaining); |
124 memcpy(new_buffer->data(), &(data->data()[bytes_to_copy]), | 124 memcpy(new_buffer->data(), &(data->data()[bytes_to_copy]), |
125 bytes_remaining); | 125 bytes_remaining); |
126 response_body_.pop_front(); | 126 response_body_.pop_front(); |
127 response_body_.push_front(make_scoped_refptr(new_buffer)); | 127 response_body_.push_front(make_scoped_refptr(new_buffer)); |
128 } | 128 } |
129 bytes_read += bytes_to_copy; | 129 bytes_read += bytes_to_copy; |
130 } | 130 } |
131 if (SpdySession::flow_control()) | 131 if (spdy_session_ && spdy_session_->is_flow_control_enabled()) |
132 stream_->IncreaseRecvWindowSize(bytes_read); | 132 stream_->IncreaseRecvWindowSize(bytes_read); |
133 return bytes_read; | 133 return bytes_read; |
134 } else if (stream_->closed()) { | 134 } else if (stream_->closed()) { |
135 return stream_->response_status(); | 135 return stream_->response_status(); |
136 } | 136 } |
137 | 137 |
138 CHECK(!user_callback_); | 138 CHECK(!user_callback_); |
139 CHECK(!user_buffer_); | 139 CHECK(!user_buffer_); |
140 CHECK_EQ(0, user_buffer_len_); | 140 CHECK_EQ(0, user_buffer_len_); |
141 | 141 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 bool SpdyHttpStream::IsSpdyHttpStream() const { | 471 bool SpdyHttpStream::IsSpdyHttpStream() const { |
472 return true; | 472 return true; |
473 } | 473 } |
474 | 474 |
475 void SpdyHttpStream::Drain(HttpNetworkSession* session) { | 475 void SpdyHttpStream::Drain(HttpNetworkSession* session) { |
476 Close(false); | 476 Close(false); |
477 delete this; | 477 delete this; |
478 } | 478 } |
479 | 479 |
480 } // namespace net | 480 } // namespace net |
OLD | NEW |