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

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

Issue 25217002: net: Reset UploadDataStream on HttpNetworkTransaction destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits 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/base/upload_data_stream.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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_.get());
163 } 163 }
164 } 164 }
165 } 165 }
166
167 if (request_ && request_->upload_data_stream)
168 request_->upload_data_stream->Reset(); // Invalidate pending callbacks.
166 } 169 }
167 170
168 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info, 171 int HttpNetworkTransaction::Start(const HttpRequestInfo* request_info,
169 const CompletionCallback& callback, 172 const CompletionCallback& callback,
170 const BoundNetLog& net_log) { 173 const BoundNetLog& net_log) {
171 SIMPLE_STATS_COUNTER("HttpNetworkTransaction.Count"); 174 SIMPLE_STATS_COUNTER("HttpNetworkTransaction.Count");
172 175
173 net_log_ = net_log; 176 net_log_ = net_log;
174 request_ = request_info; 177 request_ = request_info;
175 start_time_ = base::Time::Now(); 178 start_time_ = base::Time::Now();
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1482 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1480 state); 1483 state);
1481 break; 1484 break;
1482 } 1485 }
1483 return description; 1486 return description;
1484 } 1487 }
1485 1488
1486 #undef STATE_CASE 1489 #undef STATE_CASE
1487 1490
1488 } // namespace net 1491 } // namespace net
OLDNEW
« no previous file with comments | « net/base/upload_data_stream.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698