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

Unified Diff: net/spdy/spdy_session.h

Issue 1411383005: Initial implementation of RequestPriority-based HTTP/2 dependencies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated tests. Created 5 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
Index: net/spdy/spdy_session.h
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 3ad5d27138d980b3d2adf9fab5cf5d73d6bbb3ce..a18aefc70323cfa1dd9d96bb5d3e219a1db2b0e4 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -516,6 +516,10 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
// HigherLayeredPool implementation:
bool CloseOneIdleConnection() override;
+ // Set whether priority->dependency conversion is enabled
+ // by default for all future SpdySessions.
+ static void SetPriorityDependencyDefaultForTesting(bool enable);
Bence 2015/11/11 18:47:15 I don't like the idea of having a global variable
Randy Smith (Not in Mondays) 2015/11/11 23:25:59 Agreed.
+
private:
friend class base::RefCounted<SpdySession>;
friend class SpdyStreamRequest;
@@ -1004,6 +1008,14 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
// them?
ActiveStreamMap active_streams_;
+ // Per-priority map from stream id to all active streams. This map will
+ // contain the same set of streams as |active_streams_|. It is used for
+ // setting dependencies to match incoming requests RequestPriority.
+ //
+ // |active_streams_by_priority_| does *not* own its SpdyStream objects.
+ std::map<SpdyStreamId, SpdyStream*>
+ active_streams_by_priority_[NUM_PRIORITIES];
+
// (Bijective) map from the URL to the ID of the streams that have
// already started to be pushed by the server, but do not have
// consumers yet. Contains a subset of |active_streams_|.
@@ -1182,6 +1194,10 @@ class NET_EXPORT SpdySession : public BufferedSpdyFramerVisitorInterface,
TimeFunc time_func_;
+ // Should priority-based depencency information be sent in stream header
Bence 2015/11/11 18:47:15 s/depencency/dependency/
Randy Smith (Not in Mondays) 2015/11/11 23:25:59 Done.
+ // frames.
+ bool send_priority_dependency_;
+
// Used for posting asynchronous IO tasks. We use this even though
// SpdySession is refcounted because we don't need to keep the SpdySession
// alive if the last reference is within a RunnableMethod. Just revoke the

Powered by Google App Engine
This is Rietveld 408576698