| Index: net/quic/chromium/bidirectional_stream_quic_impl.cc
|
| diff --git a/net/quic/chromium/bidirectional_stream_quic_impl.cc b/net/quic/chromium/bidirectional_stream_quic_impl.cc
|
| index 2f5ad1dd1ed61062f1e1ab6933e81da514dc1221..e2301e76669373aee997163238f4870d5ff55bfd 100644
|
| --- a/net/quic/chromium/bidirectional_stream_quic_impl.cc
|
| +++ b/net/quic/chromium/bidirectional_stream_quic_impl.cc
|
| @@ -232,15 +232,6 @@ bool BidirectionalStreamQuicImpl::GetLoadTimingInfo(
|
| return true;
|
| }
|
|
|
| -void BidirectionalStreamQuicImpl::OnTrailingHeadersAvailable(
|
| - const SpdyHeaderBlock& headers,
|
| - size_t frame_len) {
|
| - headers_bytes_received_ += frame_len;
|
| - if (delegate_)
|
| - delegate_->OnTrailersReceived(headers);
|
| - // |this| can be destroyed after this point.
|
| -}
|
| -
|
| void BidirectionalStreamQuicImpl::OnClose() {
|
| DCHECK(stream_);
|
|
|
| @@ -308,10 +299,36 @@ void BidirectionalStreamQuicImpl::OnReadInitialHeadersComplete(int rv) {
|
| headers_bytes_received_ += rv;
|
| negotiated_protocol_ = kProtoQUIC;
|
| connect_timing_ = session_->GetConnectTiming();
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| + FROM_HERE, base::Bind(&BidirectionalStreamQuicImpl::ReadTrailingHeaders,
|
| + weak_factory_.GetWeakPtr()));
|
| if (delegate_)
|
| delegate_->OnHeadersReceived(initial_headers_);
|
| }
|
|
|
| +void BidirectionalStreamQuicImpl::ReadTrailingHeaders() {
|
| + int rv = stream_->ReadTrailingHeaders(
|
| + &trailing_headers_,
|
| + base::Bind(&BidirectionalStreamQuicImpl::OnReadTrailingHeadersComplete,
|
| + weak_factory_.GetWeakPtr()));
|
| +
|
| + if (rv != ERR_IO_PENDING)
|
| + OnReadTrailingHeadersComplete(rv);
|
| +}
|
| +
|
| +void BidirectionalStreamQuicImpl::OnReadTrailingHeadersComplete(int rv) {
|
| + DCHECK_NE(ERR_IO_PENDING, rv);
|
| + if (rv < 0) {
|
| + NotifyError(rv);
|
| + return;
|
| + }
|
| +
|
| + headers_bytes_received_ += rv;
|
| +
|
| + if (delegate_)
|
| + delegate_->OnTrailersReceived(trailing_headers_);
|
| +}
|
| +
|
| void BidirectionalStreamQuicImpl::OnReadDataComplete(int rv) {
|
| DCHECK_GE(rv, 0);
|
| read_buffer_ = nullptr;
|
|
|