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

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

Issue 2298823002: Resetting the HttpRequestInfo pointers in HttpNetworkTransaction and streams (Closed)
Patch Set: Rebased till refs/heads/master@{#425377} Created 4 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
« no previous file with comments | « net/http/http_stream_parser.h ('k') | net/http/http_transaction.h » ('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_stream_parser.h" 5 #include "net/http/http_stream_parser.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 // Added to investigate crbug.com/499663. 373 // Added to investigate crbug.com/499663.
374 CHECK(buf); 374 CHECK(buf);
375 375
376 if (io_state_ == STATE_DONE) 376 if (io_state_ == STATE_DONE)
377 return OK; 377 return OK;
378 378
379 user_read_buf_ = buf; 379 user_read_buf_ = buf;
380 user_read_buf_len_ = buf_len; 380 user_read_buf_len_ = buf_len;
381 io_state_ = STATE_READ_BODY; 381 io_state_ = STATE_READ_BODY;
382 382
383 // Invalidate HttpRequestInfo pointer. This is to allow the stream to be
384 // shared across multiple consumers.
385 // It is safe to reset it at this point since request_->upload_data_stream
386 // is also not needed anymore.
387 request_ = nullptr;
388
383 int result = DoLoop(OK); 389 int result = DoLoop(OK);
384 if (result == ERR_IO_PENDING) 390 if (result == ERR_IO_PENDING)
385 callback_ = callback; 391 callback_ = callback;
386 392
387 return result; 393 return result;
388 } 394 }
389 395
390 void HttpStreamParser::OnIOComplete(int result) { 396 void HttpStreamParser::OnIOComplete(int result) {
391 result = DoLoop(result); 397 result = DoLoop(result);
392 398
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status, 1228 UMA_HISTOGRAM_ENUMERATION("Net.HttpStatusLineStatus", status,
1223 HttpStatusLineValidator::STATUS_LINE_MAX); 1229 HttpStatusLineValidator::STATUS_LINE_MAX);
1224 } 1230 }
1225 1231
1226 bool HttpStreamParser::SendRequestBuffersEmpty() { 1232 bool HttpStreamParser::SendRequestBuffersEmpty() {
1227 return request_headers_ == nullptr && request_body_send_buf_ == nullptr && 1233 return request_headers_ == nullptr && request_body_send_buf_ == nullptr &&
1228 request_body_send_buf_ == nullptr; 1234 request_body_send_buf_ == nullptr;
1229 } 1235 }
1230 1236
1231 } // namespace net 1237 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_parser.h ('k') | net/http/http_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698