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/chromium/quic_chromium_client_session.h" | 5 #include "net/quic/chromium/quic_chromium_client_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1427 streams_pushed_and_claimed_count_++; | 1427 streams_pushed_and_claimed_count_++; |
1428 QuicClientSessionBase::DeletePromised(promised); | 1428 QuicClientSessionBase::DeletePromised(promised); |
1429 } | 1429 } |
1430 | 1430 |
1431 void QuicChromiumClientSession::OnPushStreamTimedOut(QuicStreamId stream_id) { | 1431 void QuicChromiumClientSession::OnPushStreamTimedOut(QuicStreamId stream_id) { |
1432 QuicSpdyStream* stream = GetPromisedStream(stream_id); | 1432 QuicSpdyStream* stream = GetPromisedStream(stream_id); |
1433 if (stream != nullptr) | 1433 if (stream != nullptr) |
1434 bytes_pushed_and_unclaimed_count_ += stream->stream_bytes_read(); | 1434 bytes_pushed_and_unclaimed_count_ += stream->stream_bytes_read(); |
1435 } | 1435 } |
1436 | 1436 |
1437 void QuicChromiumClientSession::CancelPush(const GURL& url) { | |
1438 QuicClientPromisedInfo* promised_info = | |
1439 QuicClientSessionBase::GetPromisedByUrl(url.spec()); | |
1440 if (!promised_info) { | |
1441 // Push stream has already been claimed. | |
1442 return; | |
1443 } | |
1444 | |
1445 QuicStreamId stream_id = promised_info->id(); | |
1446 | |
1447 // Collect data on the cancelled push stream. | |
1448 QuicSpdyStream* stream = GetPromisedStream(stream_id); | |
1449 if (stream != nullptr) | |
1450 bytes_pushed_and_unclaimed_count_ += stream->stream_bytes_read(); | |
1451 | |
1452 // Remove the promised info from the promise index and send the reset. | |
1453 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
| |
1454 QuicClientSessionBase::ResetPromised(stream_id, QUIC_STREAM_CANCELLED); | |
1455 } | |
1456 | |
1437 const LoadTimingInfo::ConnectTiming& | 1457 const LoadTimingInfo::ConnectTiming& |
1438 QuicChromiumClientSession::GetConnectTiming() { | 1458 QuicChromiumClientSession::GetConnectTiming() { |
1439 connect_timing_.ssl_start = connect_timing_.connect_start; | 1459 connect_timing_.ssl_start = connect_timing_.connect_start; |
1440 connect_timing_.ssl_end = connect_timing_.connect_end; | 1460 connect_timing_.ssl_end = connect_timing_.connect_end; |
1441 return connect_timing_; | 1461 return connect_timing_; |
1442 } | 1462 } |
1443 | 1463 |
1444 } // namespace net | 1464 } // namespace net |
OLD | NEW |