summaryrefslogtreecommitdiff
path: root/chromium/net/tools/quic/spdy_balsa_utils.h
blob: a1d555a642b2484fdac6e020da60814cc541435c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_TOOLS_QUIC_SPDY_BALSA_UTILS_H_
#define NET_TOOLS_QUIC_SPDY_BALSA_UTILS_H_

#include <string>

#include "base/macros.h"
#include "net/quic/quic_protocol.h"
#include "net/spdy/spdy_framer.h"
#include "net/spdy/spdy_header_block.h"
#include "net/spdy/spdy_protocol.h"
#include "net/tools/balsa/balsa_headers.h"

namespace net {

class SpdyBalsaUtils {
 public:
  static std::string SerializeResponseHeaders(
      const BalsaHeaders& response_headers);

  static SpdyHeaderBlock RequestHeadersToSpdyHeaders(
      const BalsaHeaders& request_headers);

  static SpdyHeaderBlock ResponseHeadersToSpdyHeaders(
      const BalsaHeaders& response_headers);

  static void SpdyHeadersToResponseHeaders(const SpdyHeaderBlock& block,
                                           BalsaHeaders* headers);

  static void SpdyHeadersToRequestHeaders(const SpdyHeaderBlock& block,
                                          BalsaHeaders* headers);

 private:
  DISALLOW_COPY_AND_ASSIGN(SpdyBalsaUtils);
};

}  // namespace net

#endif  // NET_TOOLS_QUIC_SPDY_BALSA_UTILS_H_