summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_http_utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/spdy/spdy_http_utils.cc')
-rw-r--r--net/spdy/spdy_http_utils.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
index e367c42..bf7376a 100644
--- a/net/spdy/spdy_http_utils.cc
+++ b/net/spdy/spdy_http_utils.cc
@@ -107,4 +107,18 @@ void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
}
+// TODO(gavinp): re-adjust this once SPDY v3 has three priority bits,
+// eliminating the need for this folding.
+int ConvertRequestPriorityToSpdyPriority(const RequestPriority priority) {
+ DCHECK(HIGHEST <= priority && priority < NUM_PRIORITIES);
+ switch (priority) {
+ case LOWEST:
+ return SPDY_PRIORITY_LOWEST - 1;
+ case IDLE:
+ return SPDY_PRIORITY_LOWEST;
+ default:
+ return priority;
+ }
+}
+
} // namespace net