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

Unified Diff: net/spdy/chromium/spdy_session_pool.h

Issue 2932513004: Throttle HttpStreamFactoryImpl::Job to HTTP/2-supported servers (Closed)
Patch Set: self Created 3 years, 6 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/chromium/spdy_session_pool.h
diff --git a/net/spdy/chromium/spdy_session_pool.h b/net/spdy/chromium/spdy_session_pool.h
index 613a3d9ed0301daaed4d6b7729cdc2262f5646ff..e3b8fc65768269a35e31d49ffabf89073cc3ec27 100644
--- a/net/spdy/chromium/spdy_session_pool.h
+++ b/net/spdy/chromium/spdy_session_pool.h
@@ -179,6 +179,17 @@ class NET_EXPORT SpdySessionPool
bool using_spdy,
NetLogSource source_dependency);
+ // Called when a HttpStreamRequest is started with |spdy_session_key|.
+ // Returns true if the request should continue. Returns false if the request
+ // should wait until |callback| is invoked before continuing.
+ bool StartRequest(const SpdySessionKey& spdy_session_key,
Bence 2017/06/09 19:17:40 Optional: return OK instead of true and discard |c
xunjieli 2017/06/13 15:23:11 Acknowledged. But the callback is not a net::Compl
+ const base::Closure& callback);
+
+ // Resumes all pending requests with |spdy_session_key|.
+ void ResumeAllPendingRequests(const SpdySessionKey& spdy_session_key);
+ // Resumes the next pending request with |spdy_session_key|.
+ void ResumeNextPendingRequest(const SpdySessionKey& spdy_session_key);
Bence 2017/06/09 19:17:40 Do you think it is worth making this method privat
xunjieli 2017/06/13 15:23:11 Done.
+
// Adds |request| to |spdy_session_request_map_| under |spdy_session_key| Key.
// Sets |spdy_session_key| as |request|'s SpdySessionKey.
void AddRequestToSpdySessionRequestMap(
@@ -271,7 +282,11 @@ class NET_EXPORT SpdySessionPool
// and maximum HPACK dynamic table size.
const SettingsMap initial_settings_;
+ // TODO(xunjieli): Merge these two.
SpdySessionRequestMap spdy_session_request_map_;
+ typedef std::map<SpdySessionKey, std::list<base::Closure>>
+ SpdySessionPendingRequestMap;
+ SpdySessionPendingRequestMap spdy_session_pending_request_map_;
TimeFunc time_func_;
ServerPushDelegate* push_delegate_;

Powered by Google App Engine
This is Rietveld 408576698