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

Side by Side Diff: net/quic/quic_http_stream.cc

Issue 2163883004: Do not invoke QuicHttpStream::DoCallback when in DoLoop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test which crashes with the exact call stack without the patch Created 4 years, 5 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 | « no previous file | net/quic/quic_http_stream_test.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/quic/quic_http_stream.h" 5 #include "net/quic/quic_http_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 if (stream_->connection_error() != QUIC_NO_ERROR || 503 if (stream_->connection_error() != QUIC_NO_ERROR ||
504 stream_->stream_error() != QUIC_STREAM_NO_ERROR) { 504 stream_->stream_error() != QUIC_STREAM_NO_ERROR) {
505 response_status_ = was_handshake_confirmed_ ? ERR_QUIC_PROTOCOL_ERROR 505 response_status_ = was_handshake_confirmed_ ? ERR_QUIC_PROTOCOL_ERROR
506 : ERR_QUIC_HANDSHAKE_FAILED; 506 : ERR_QUIC_HANDSHAKE_FAILED;
507 } else if (!response_headers_received_) { 507 } else if (!response_headers_received_) {
508 response_status_ = ERR_ABORTED; 508 response_status_ = ERR_ABORTED;
509 } 509 }
510 510
511 quic_connection_error_ = stream_->connection_error(); 511 quic_connection_error_ = stream_->connection_error();
512 ResetStream(); 512 ResetStream();
513 if (in_loop_) {
514 // If already in DoLoop(), |callback_| will be handled when DoLoop() exits.
515 return;
516 }
Ryan Hamilton 2016/07/21 22:29:33 Do you know what state in DoLoop we're in when thi
xunjieli 2016/07/22 13:21:22 According to the crash log on crbug/629043, we are
513 if (!callback_.is_null()) { 517 if (!callback_.is_null()) {
514 DoCallback(response_status_); 518 DoCallback(response_status_);
515 } 519 }
516 } 520 }
517 521
518 void QuicHttpStream::OnError(int error) { 522 void QuicHttpStream::OnError(int error) {
519 ResetStream(); 523 ResetStream();
520 response_status_ = 524 response_status_ =
521 was_handshake_confirmed_ ? error : ERR_QUIC_HANDSHAKE_FAILED; 525 was_handshake_confirmed_ ? error : ERR_QUIC_HANDSHAKE_FAILED;
522 if (!callback_.is_null()) 526 if (!callback_.is_null())
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); 827 closed_stream_sent_bytes_ = stream_->stream_bytes_written();
824 stream_ = nullptr; 828 stream_ = nullptr;
825 829
826 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress 830 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress
827 // read. 831 // read.
828 if (request_body_stream_) 832 if (request_body_stream_)
829 request_body_stream_->Reset(); 833 request_body_stream_->Reset();
830 } 834 }
831 835
832 } // namespace net 836 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698