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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 } else { | 152 } else { |
153 if (stream_->IsResponseBodyComplete()) { | 153 if (stream_->IsResponseBodyComplete()) { |
154 // If the response body is complete, we can just reuse the socket. | 154 // If the response body is complete, we can just reuse the socket. |
155 stream_->Close(false /* reusable */); | 155 stream_->Close(false /* reusable */); |
156 } else if (stream_->IsSpdyHttpStream()) { | 156 } else if (stream_->IsSpdyHttpStream()) { |
157 // Doesn't really matter for SpdyHttpStream. Just close it. | 157 // Doesn't really matter for SpdyHttpStream. Just close it. |
158 stream_->Close(true /* not reusable */); | 158 stream_->Close(true /* not reusable */); |
159 } else { | 159 } else { |
160 // Otherwise, we try to drain the response body. | 160 // Otherwise, we try to drain the response body. |
161 HttpStreamBase* stream = stream_.release(); | 161 HttpStreamBase* stream = stream_.release(); |
162 stream->Drain(session_.get()); | 162 stream->Drain(session_); |
163 } | 163 } |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 if (request_ && request_->upload_data_stream) | 167 if (request_ && request_->upload_data_stream) |
168 request_->upload_data_stream->Reset(); // Invalidate pending callbacks. | 168 request_->upload_data_stream->Reset(); // Invalidate pending callbacks. |
169 } | 169 } |
170 | 170 |
171 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, | 171 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, |
172 const CompletionCallback& callback, | 172 const CompletionCallback& callback, |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 1487 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
1488 state); | 1488 state); |
1489 break; | 1489 break; |
1490 } | 1490 } |
1491 return description; | 1491 return description; |
1492 } | 1492 } |
1493 | 1493 |
1494 #undef STATE_CASE | 1494 #undef STATE_CASE |
1495 | 1495 |
1496 } // namespace net | 1496 } // namespace net |
OLD | NEW |