| 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/http/http_response_body_drainer.h" | 5 #include "net/http/http_response_body_drainer.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/http/http_network_session.h" | 11 #include "net/http/http_network_session.h" |
| 12 #include "net/http/http_stream.h" | 12 #include "net/http/http_stream.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 HttpResponseBodyDrainer::HttpResponseBodyDrainer(HttpStream* stream) | 16 HttpResponseBodyDrainer::HttpResponseBodyDrainer(HttpStream* stream) |
| 17 : stream_(stream), | 17 : read_size_(0), |
| 18 stream_(stream), |
| 18 next_state_(STATE_NONE), | 19 next_state_(STATE_NONE), |
| 19 total_read_(0), | 20 total_read_(0), |
| 20 session_(NULL) {} | 21 session_(NULL) {} |
| 21 | 22 |
| 22 HttpResponseBodyDrainer::~HttpResponseBodyDrainer() {} | 23 HttpResponseBodyDrainer::~HttpResponseBodyDrainer() {} |
| 23 | 24 |
| 24 void HttpResponseBodyDrainer::Start(HttpNetworkSession* session) { | 25 void HttpResponseBodyDrainer::Start(HttpNetworkSession* session) { |
| 25 StartWithSize(session, kDrainBodyBufferSize); | 26 StartWithSize(session, kDrainBodyBufferSize); |
| 26 } | 27 } |
| 27 | 28 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 stream_->Close(true /* no keep-alive */); | 135 stream_->Close(true /* no keep-alive */); |
| 135 } else { | 136 } else { |
| 136 DCHECK_EQ(OK, result); | 137 DCHECK_EQ(OK, result); |
| 137 stream_->Close(false /* keep-alive */); | 138 stream_->Close(false /* keep-alive */); |
| 138 } | 139 } |
| 139 | 140 |
| 140 delete this; | 141 delete this; |
| 141 } | 142 } |
| 142 | 143 |
| 143 } // namespace net | 144 } // namespace net |
| OLD | NEW |