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/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_base.h" | 12 #include "net/http/http_stream.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 HttpResponseBodyDrainer::HttpResponseBodyDrainer(HttpStreamBase* stream) | 16 HttpResponseBodyDrainer::HttpResponseBodyDrainer(HttpStream* stream) |
17 : stream_(stream), | 17 : stream_(stream), |
18 next_state_(STATE_NONE), | 18 next_state_(STATE_NONE), |
19 total_read_(0), | 19 total_read_(0), |
20 session_(NULL) {} | 20 session_(NULL) {} |
21 | 21 |
22 HttpResponseBodyDrainer::~HttpResponseBodyDrainer() {} | 22 HttpResponseBodyDrainer::~HttpResponseBodyDrainer() {} |
23 | 23 |
24 void HttpResponseBodyDrainer::Start(HttpNetworkSession* session) { | 24 void HttpResponseBodyDrainer::Start(HttpNetworkSession* session) { |
25 read_buf_ = new IOBuffer(kDrainBodyBufferSize); | 25 read_buf_ = new IOBuffer(kDrainBodyBufferSize); |
26 next_state_ = STATE_DRAIN_RESPONSE_BODY; | 26 next_state_ = STATE_DRAIN_RESPONSE_BODY; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 stream_->Close(true /* no keep-alive */); | 117 stream_->Close(true /* no keep-alive */); |
118 } else { | 118 } else { |
119 DCHECK_EQ(OK, result); | 119 DCHECK_EQ(OK, result); |
120 stream_->Close(false /* keep-alive */); | 120 stream_->Close(false /* keep-alive */); |
121 } | 121 } |
122 | 122 |
123 delete this; | 123 delete this; |
124 } | 124 } |
125 | 125 |
126 } // namespace net | 126 } // namespace net |
OLD | NEW |