Chromium Code Reviews| Index: net/quic/chromium/quic_chromium_client_session.cc |
| diff --git a/net/quic/chromium/quic_chromium_client_session.cc b/net/quic/chromium/quic_chromium_client_session.cc |
| index 081aff1e1b7d3d8cf89b5a08b38c72331d6dfb15..15438d7c726324bcf8103b41ead8f13ac9534ca2 100644 |
| --- a/net/quic/chromium/quic_chromium_client_session.cc |
| +++ b/net/quic/chromium/quic_chromium_client_session.cc |
| @@ -1434,6 +1434,26 @@ void QuicChromiumClientSession::OnPushStreamTimedOut(QuicStreamId stream_id) { |
| bytes_pushed_and_unclaimed_count_ += stream->stream_bytes_read(); |
| } |
| +void QuicChromiumClientSession::CancelPush(const GURL& url) { |
| + QuicClientPromisedInfo* promised_info = |
| + QuicClientSessionBase::GetPromisedByUrl(url.spec()); |
| + if (!promised_info) { |
| + // Push stream has already been claimed. |
| + return; |
| + } |
| + |
| + QuicStreamId stream_id = promised_info->id(); |
| + |
| + // Collect data on the cancelled push stream. |
| + QuicSpdyStream* stream = GetPromisedStream(stream_id); |
| + if (stream != nullptr) |
| + bytes_pushed_and_unclaimed_count_ += stream->stream_bytes_read(); |
| + |
| + // Remove the promised info from the promise index and send the reset. |
| + DeletePromised(promised_info); |
|
Ryan Hamilton
2016/10/27 17:00:25
I'm a bit surprised to see the delete before the r
Zhongyi Shi
2016/10/27 17:57:29
The other order also works. DeletePromised() delet
|
| + QuicClientSessionBase::ResetPromised(stream_id, QUIC_STREAM_CANCELLED); |
| +} |
| + |
| const LoadTimingInfo::ConnectTiming& |
| QuicChromiumClientSession::GetConnectTiming() { |
| connect_timing_.ssl_start = connect_timing_.connect_start; |