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

Unified Diff: net/spdy/spdy_http_utils.cc

Issue 1866483002: Add a new priority level, THROTTLED, below IDLE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync'd to p390110 Created 4 years, 7 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_http_utils.cc
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
index 573bce18b8f893b1ba15fb0fa8c5dd759ea625db..252439f34b9431fde24d0fd6874c3b37f9392db0 100644
--- a/net/spdy/spdy_http_utils.cc
+++ b/net/spdy/spdy_http_utils.cc
@@ -173,7 +173,7 @@ void CreateSpdyHeadersFromHttpResponse(
}
}
-static_assert(HIGHEST - LOWEST < 4 && HIGHEST - MINIMUM_PRIORITY < 5,
+static_assert(HIGHEST - LOWEST < 4 && HIGHEST - MINIMUM_PRIORITY < 6,
"request priority incompatible with spdy");
SpdyPriority ConvertRequestPriorityToSpdyPriority(
mmenke 2016/05/09 19:25:42 Need to have the QUIC/SPDY teams weigh in on chang
Randy Smith (Not in Mondays) 2016/05/11 21:30:25 Ryan, are you willing to play a SPDY expert on TV,
@@ -188,9 +188,9 @@ NET_EXPORT_PRIVATE RequestPriority ConvertSpdyPriorityToRequestPriority(
SpdyPriority priority,
SpdyMajorVersion protocol_version) {
// Handle invalid values gracefully.
- // Note that SpdyPriority is not an enum, hence the magic constants.
- return (priority >= 5) ?
- IDLE : static_cast<RequestPriority>(4 - priority);
+ return (priority > (MAXIMUM_PRIORITY - MINIMUM_PRIORITY))
mmenke 2016/05/09 19:25:42 This maps IDLE priority to 4, THROTTLED to 5, and
Randy Smith (Not in Mondays) 2016/05/11 21:30:25 Because of ">" rather than ">="? Because the QUIC
Ryan Hamilton 2016/05/12 22:25:46 Because QuicPriority != SpdyPriority ... except th
+ ? IDLE
+ : static_cast<RequestPriority>(MAXIMUM_PRIORITY - priority);
}
NET_EXPORT_PRIVATE void ConvertHeaderBlockToHttpRequestHeaders(

Powered by Google App Engine
This is Rietveld 408576698