Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: net/http/http_network_transaction.cc

Issue 24246016: Make HttpNetworkTransaction no longer own a reference to HttpNetworkSession. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Sync, fix new test Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/http/http_network_transaction.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698