blob: d6f1a653fd392274e8f3499d5c8699dcde1c2ee8 [file] [log] [blame]
[email protected]66a4b6d2011-05-19 23:36:161// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]fa522e72010-09-15 23:36:292// 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]172da1b2011-08-12 15:52:269#include "net/base/net_export.h"
[email protected]9e1bdd32011-02-03 21:48:3410#include "net/base/request_priority.h"
[email protected]fa522e72010-09-15 23:36:2911#include "net/spdy/spdy_framer.h"
12
13namespace net {
14
15class HttpResponseInfo;
[email protected]86f56f62010-09-15 23:58:1816struct HttpRequestInfo;
[email protected]7213e7c2010-10-20 15:33:5217class HttpRequestHeaders;
[email protected]fa522e72010-09-15 23:36:2918
19// Convert a SpdyHeaderBlock into an HttpResponseInfo.
20// |headers| input parameter with the SpdyHeaderBlock.
21// |info| output parameter for the HttpResponseInfo.
[email protected]740bbbec2010-12-07 06:36:0122// Returns true if successfully converted. False if the SpdyHeaderBlock is
23// incomplete (e.g. missing 'status' or 'version').
[email protected]fa522e72010-09-15 23:36:2924bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers,
25 HttpResponseInfo* response);
26
27// Create a SpdyHeaderBlock for a Spdy SYN_STREAM Frame from
[email protected]7213e7c2010-10-20 15:33:5228// HttpRequestInfo and HttpRequestHeaders.
[email protected]fa522e72010-09-15 23:36:2929void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
[email protected]7213e7c2010-10-20 15:33:5230 const HttpRequestHeaders& request_headers,
[email protected]fa522e72010-09-15 23:36:2931 spdy::SpdyHeaderBlock* headers,
32 bool direct);
33
[email protected]172da1b2011-08-12 15:52:2634NET_EXPORT_PRIVATE int ConvertRequestPriorityToSpdyPriority(
35 RequestPriority priority);
[email protected]9e1bdd32011-02-03 21:48:3436
[email protected]fa522e72010-09-15 23:36:2937} // namespace net
38
39#endif // NET_SPDY_SPDY_HTTP_UTILS_H_