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

Unified Diff: net/spdy/spdy_session.h

Issue 2458793002: Server push cancellation: add PushPromiseHelper which reflects information on the push promise. (Closed)
Patch Set: sync and fix tests Created 4 years, 1 month 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/server_push_delegate.h ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.h
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 61f0632fa9e00d27efaf9ab351c8eef8d32897a6..705477d4b9a2a722dd5ebb9fa5b623a8d76010fc 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -33,6 +33,7 @@
#include "net/socket/stream_socket.h"
#include "net/spdy/buffered_spdy_framer.h"
#include "net/spdy/http2_priority_dependencies.h"
+#include "net/spdy/server_push_delegate.h"
#include "net/spdy/spdy_alt_svc_wire_format.h"
#include "net/spdy/spdy_buffer.h"
#include "net/spdy/spdy_framer.h"
@@ -326,6 +327,14 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
base::WeakPtr<SpdyStream>* spdy_stream,
const NetLogWithSource& stream_net_log);
+ void set_push_delegate(ServerPushDelegate* push_delegate) {
+ push_delegate_ = push_delegate;
+ }
+
+ // Called when the pushed stream should be cancelled. If the pushed stream is
+ // not claimed and active, sends RST to the server to cancel the stream.
+ void CancelPush(const GURL& url);
+
// Initialize the session with the given connection. |is_secure|
// must indicate whether |connection| uses an SSL socket or not; it
// is usually true, but it can be false for testing or when SPDY is
@@ -574,6 +583,7 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, DeleteExpiredPushStreams);
FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, MetricsCollectionOnPushStreams);
FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, CancelPushBeforeClaimed);
+ FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, CancelPushAfterSessionGoesAway);
FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, CancelPushAfterExpired);
FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ProtocolNegotiation);
FRIEND_TEST_ALL_PREFIXES(SpdySessionTest, ClearSettings);
@@ -677,10 +687,6 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
SpdyPriority priority,
SpdyHeaderBlock headers);
- // Called when the pushed stream should be cancelled. If the pushed stream is
- // not claimed and active, sends RST to the server to cancel the stream.
- void CancelPush(const GURL& url);
-
// Close the stream pointed to by the given iterator. Note that that
// stream may hold the last reference to the session.
void CloseActiveStreamIterator(ActiveStreamMap::iterator it, int status);
@@ -1043,6 +1049,10 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
UnclaimedPushedStreamContainer unclaimed_pushed_streams_;
+ // Not owned. |push_delegate_| outlives the session and handles server pushes
+ // received by session.
+ ServerPushDelegate* push_delegate_;
+
// Set of all created streams but that have not yet sent any frames.
//
// |created_streams_| owns all its SpdyStream objects.
« no previous file with comments | « net/spdy/server_push_delegate.h ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698