OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef NET_SPDY_SPDY_HTTP_UTILS_H_ | 5 #ifndef NET_SPDY_SPDY_HTTP_UTILS_H_ |
6 #define NET_SPDY_SPDY_HTTP_UTILS_H_ | 6 #define NET_SPDY_SPDY_HTTP_UTILS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "net/base/net_api.h" | 9 #include "net/base/net_export.h" |
10 #include "net/base/request_priority.h" | 10 #include "net/base/request_priority.h" |
11 #include "net/spdy/spdy_framer.h" | 11 #include "net/spdy/spdy_framer.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 class HttpResponseInfo; | 15 class HttpResponseInfo; |
16 struct HttpRequestInfo; | 16 struct HttpRequestInfo; |
17 class HttpRequestHeaders; | 17 class HttpRequestHeaders; |
18 | 18 |
19 // Convert a SpdyHeaderBlock into an HttpResponseInfo. | 19 // Convert a SpdyHeaderBlock into an HttpResponseInfo. |
20 // |headers| input parameter with the SpdyHeaderBlock. | 20 // |headers| input parameter with the SpdyHeaderBlock. |
21 // |info| output parameter for the HttpResponseInfo. | 21 // |info| output parameter for the HttpResponseInfo. |
22 // Returns true if successfully converted. False if the SpdyHeaderBlock is | 22 // Returns true if successfully converted. False if the SpdyHeaderBlock is |
23 // incomplete (e.g. missing 'status' or 'version'). | 23 // incomplete (e.g. missing 'status' or 'version'). |
24 bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, | 24 bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers, |
25 HttpResponseInfo* response); | 25 HttpResponseInfo* response); |
26 | 26 |
27 // Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from | 27 // Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from |
28 // HttpRequestInfo and HttpRequestHeaders. | 28 // HttpRequestInfo and HttpRequestHeaders. |
29 void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, | 29 void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info, |
30 const HttpRequestHeaders& request_headers, | 30 const HttpRequestHeaders& request_headers, |
31 spdy::SpdyHeaderBlock* headers, | 31 spdy::SpdyHeaderBlock* headers, |
32 bool direct); | 32 bool direct); |
33 | 33 |
34 NET_TEST int ConvertRequestPriorityToSpdyPriority(RequestPriority priority); | 34 NET_EXPORT_PRIVATE int ConvertRequestPriorityToSpdyPriority( |
| 35 RequestPriority priority); |
35 | 36 |
36 } // namespace net | 37 } // namespace net |
37 | 38 |
38 #endif // NET_SPDY_SPDY_HTTP_UTILS_H_ | 39 #endif // NET_SPDY_SPDY_HTTP_UTILS_H_ |
OLD | NEW |