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

Unified Diff: net/spdy/spdy_http_utils.cc

Issue 10187006: Remove SPDY priority #defines from spdy_protocol.h since they differ between SPDY 2 and SPDY 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « no previous file | net/spdy/spdy_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_http_utils.cc
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
index 0a0df47c4658b80e2e962d2f5bcb0a4cb15f6088..f029a994081425ce2cebb80d2312b88ad007109e 100644
--- a/net/spdy/spdy_http_utils.cc
+++ b/net/spdy/spdy_http_utils.cc
@@ -130,15 +130,15 @@ SpdyPriority ConvertRequestPriorityToSpdyPriority(
int protocol_version) {
DCHECK(HIGHEST <= priority && priority < NUM_PRIORITIES);
if (protocol_version == 2) {
- switch (priority) {
- case LOWEST:
- return SPDY_PRIORITY_LOWEST - 1;
- case IDLE:
- return SPDY_PRIORITY_LOWEST;
- default:
- return priority;
+ // SPDY 2 only has 2 bits of priority, but we have 5 RequestPriorities.
+ if (priority < LOWEST) {
+ return priority;
+ } else {
+ DCHECK_GE(4, priority);
+ return priority - 1;
}
} else {
+ DCHECK_GE(7, priority);
return priority;
}
}
« no previous file with comments | « no previous file | net/spdy/spdy_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698