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