| 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..5900d559d70f3e40a0d39f47b4495ea296e71385 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(
|
| @@ -181,16 +181,19 @@ SpdyPriority ConvertRequestPriorityToSpdyPriority(
|
| SpdyMajorVersion protocol_version) {
|
| DCHECK_GE(priority, MINIMUM_PRIORITY);
|
| DCHECK_LE(priority, MAXIMUM_PRIORITY);
|
| - return static_cast<SpdyPriority>(MAXIMUM_PRIORITY - priority);
|
| + return static_cast<SpdyPriority>(MAXIMUM_PRIORITY - priority +
|
| + kV3HighestPriority);
|
| }
|
|
|
| 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 - kV3HighestPriority) >
|
| + (MAXIMUM_PRIORITY - MINIMUM_PRIORITY))
|
| + ? IDLE
|
| + : static_cast<RequestPriority>(MAXIMUM_PRIORITY -
|
| + (priority - kV3HighestPriority));
|
| }
|
|
|
| NET_EXPORT_PRIVATE void ConvertHeaderBlockToHttpRequestHeaders(
|
|
|