Chromium Code Reviews| 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/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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |