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 "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 430 void QuicHttpStream::Drain(HttpNetworkSession* session) { | 430 void QuicHttpStream::Drain(HttpNetworkSession* session) { |
| 431 NOTREACHED(); | 431 NOTREACHED(); |
| 432 Close(false); | 432 Close(false); |
| 433 delete this; | 433 delete this; |
| 434 } | 434 } |
| 435 | 435 |
| 436 void QuicHttpStream::PopulateNetErrorDetails(NetErrorDetails* details) { | 436 void QuicHttpStream::PopulateNetErrorDetails(NetErrorDetails* details) { |
| 437 details->connection_info = HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3; | 437 details->connection_info = HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3; |
| 438 if (was_handshake_confirmed_) | 438 if (was_handshake_confirmed_) |
| 439 details->quic_connection_error = quic_connection_error_; | 439 details->quic_connection_error = quic_connection_error_; |
| 440 if (session_) | |
|
Ryan Hamilton
2016/03/11 22:48:58
In the case that there is no session, I wonder if
Zhongyi Shi
2016/03/11 23:15:30
Good point! I changed the method of OnSessionClose
| |
| 441 session_->PopulateNetErrorDetails(details); | |
| 440 } | 442 } |
| 441 | 443 |
| 442 void QuicHttpStream::SetPriority(RequestPriority priority) { | 444 void QuicHttpStream::SetPriority(RequestPriority priority) { |
| 443 priority_ = priority; | 445 priority_ = priority; |
| 444 } | 446 } |
| 445 | 447 |
| 446 void QuicHttpStream::OnHeadersAvailable(const SpdyHeaderBlock& headers, | 448 void QuicHttpStream::OnHeadersAvailable(const SpdyHeaderBlock& headers, |
| 447 size_t frame_len) { | 449 size_t frame_len) { |
| 448 headers_bytes_received_ += frame_len; | 450 headers_bytes_received_ += frame_len; |
| 449 | 451 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 741 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); | 743 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
| 742 stream_ = nullptr; | 744 stream_ = nullptr; |
| 743 | 745 |
| 744 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress | 746 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress |
| 745 // read. | 747 // read. |
| 746 if (request_body_stream_) | 748 if (request_body_stream_) |
| 747 request_body_stream_->Reset(); | 749 request_body_stream_->Reset(); |
| 748 } | 750 } |
| 749 | 751 |
| 750 } // namespace net | 752 } // namespace net |
| OLD | NEW |