summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_http_utils.cc
diff options
context:
space:
mode:
authorrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-17 20:51:57 +0000
committerrch@chromium.org <rch@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-17 20:51:57 +0000
commit7207444043c9805d032bc6d03c2ffef1e747e5ce (patch)
tree717fe87e9c796ee3904a3d7a6aa30ca2237c5548 /net/spdy/spdy_http_utils.cc
parentf16efd0d09dc0e16ac700a449f3f387f744718e3 (diff)
downloadchromium_src-7207444043c9805d032bc6d03c2ffef1e747e5ce.zip
chromium_src-7207444043c9805d032bc6d03c2ffef1e747e5ce.tar.gz
chromium_src-7207444043c9805d032bc6d03c2ffef1e747e5ce.tar.bz2
Make ConvertRequestPriorityToSpdyPriority aware of new SPDY 3 priorities.
BUG=123278 TEST=net_unittests Review URL: http://codereview.chromium.org/10105034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132642 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_http_utils.cc')
-rw-r--r--net/spdy/spdy_http_utils.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
index 232caeb..0a0df47 100644
--- a/net/spdy/spdy_http_utils.cc
+++ b/net/spdy/spdy_http_utils.cc
@@ -125,17 +125,21 @@ 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) {
+SpdyPriority ConvertRequestPriorityToSpdyPriority(
+ const RequestPriority priority,
+ int protocol_version) {
DCHECK(HIGHEST <= priority && priority < NUM_PRIORITIES);
- switch (priority) {
- case LOWEST:
- return SPDY_PRIORITY_LOWEST - 1;
- case IDLE:
- return SPDY_PRIORITY_LOWEST;
- default:
- return priority;
+ if (protocol_version == 2) {
+ switch (priority) {
+ case LOWEST:
+ return SPDY_PRIORITY_LOWEST - 1;
+ case IDLE:
+ return SPDY_PRIORITY_LOWEST;
+ default:
+ return priority;
+ }
+ } else {
+ return priority;
}
}