Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Unified Diff: net/quic/chromium/quic_chromium_client_session.cc

Issue 2456713002: Server push cancellation: add methods in session layer to cancel push given the pushed url. Not in … (Closed)
Patch Set: address rch's comments Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..72fab95b2afcbfa5ccf40224efec042b2cd9cff1 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();
+
+ // Send the reset and remove the promised info from the promise index.
+ QuicClientSessionBase::ResetPromised(stream_id, QUIC_STREAM_CANCELLED);
+ DeletePromised(promised_info);
+}
+
const LoadTimingInfo::ConnectTiming&
QuicChromiumClientSession::GetConnectTiming() {
connect_timing_.ssl_start = connect_timing_.connect_start;
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session.h ('k') | net/quic/chromium/quic_chromium_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698