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

Unified Diff: net/spdy/spdy_session.h

Issue 2458793002: Server push cancellation: add PushPromiseHelper which reflects information on the push promise. (Closed)
Patch Set: add PushDelegate 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/spdy/spdy_session.h
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 61f0632fa9e00d27efaf9ab351c8eef8d32897a6..faf890c3b8eb03b2cb7605e18e6b0ba5cee3c6b5 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/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(PushDelegate* push_delegate) {
Ryan Hamilton 2016/10/28 00:32:22 nit: Comment on ownership of |push_delegate|, eith
Zhongyi Shi 2016/11/07 22:07:04 Done.
+ push_delegate_ = push_delegate;
+ }
Ryan Hamilton 2016/10/28 00:32:22 Can this come in via the constructor, or is that p
Zhongyi Shi 2016/11/07 22:07:04 It's hard for SpdySession. Especially in spdy_sess
+
+ // 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,8 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
UnclaimedPushedStreamContainer unclaimed_pushed_streams_;
+ PushDelegate* push_delegate_;
Ryan Hamilton 2016/10/28 00:32:22 Can you add a comment which explains what this is
Zhongyi Shi 2016/11/07 22:07:04 Done.
+
// Set of all created streams but that have not yet sent any frames.
//
// |created_streams_| owns all its SpdyStream objects.

Powered by Google App Engine
This is Rietveld 408576698