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

Unified Diff: net/spdy/spdy_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
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 616685d41f47d83e6db0c7e50858c6ef245fcd96..272ff25972dff52851288398a25ae02799889aad 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -2637,6 +2637,21 @@ bool SpdySession::TryCreatePushStream(SpdyStreamId stream_id,
return true;
}
+void SpdySession::CancelPush(const GURL& url) {
+ UnclaimedPushedStreamContainer::const_iterator unclaimed_it =
+ unclaimed_pushed_streams_.find(url);
+ if (unclaimed_it == unclaimed_pushed_streams_.end())
+ return;
+
+ SpdyStreamId stream_id = unclaimed_it->second.stream_id;
+
+ if (active_streams_.find(stream_id) == active_streams_.end()) {
+ ResetStream(stream_id, RST_STREAM_CANCEL,
+ "Cancelled push stream with url: " + url.spec());
+ }
+ unclaimed_pushed_streams_.erase(unclaimed_it);
+}
+
void SpdySession::OnPushPromise(SpdyStreamId stream_id,
SpdyStreamId promised_stream_id,
SpdyHeaderBlock headers) {
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/spdy/spdy_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698