Home | History | Annotate | Download | only in quic
      1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
      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_TOOLS_QUIC_SPDY_UTILS_H_
      6 #define NET_TOOLS_QUIC_SPDY_UTILS_H_
      7 
      8 #include <string>
      9 
     10 #include "net/spdy/spdy_framer.h"
     11 #include "net/spdy/spdy_header_block.h"
     12 #include "net/spdy/spdy_protocol.h"
     13 #include "net/tools/balsa/balsa_headers.h"
     14 
     15 namespace net {
     16 namespace tools {
     17 
     18 class SpdyUtils {
     19  public:
     20   static std::string SerializeRequestHeaders(
     21       const BalsaHeaders& request_headers);
     22 
     23   static std::string SerializeResponseHeaders(
     24       const BalsaHeaders& response_headers);
     25 
     26   static bool FillBalsaRequestHeaders(const SpdyHeaderBlock& header_block,
     27                                       BalsaHeaders* request_headers);
     28 
     29   static bool FillBalsaResponseHeaders(const SpdyHeaderBlock& header_block,
     30                                        BalsaHeaders* response_headers);
     31 
     32   static SpdyHeaderBlock RequestHeadersToSpdyHeaders(
     33       const BalsaHeaders& request_headers);
     34 
     35   static SpdyHeaderBlock ResponseHeadersToSpdyHeaders(
     36       const BalsaHeaders& response_headers);
     37 
     38   static std::string SerializeUncompressedHeaders(
     39       const SpdyHeaderBlock& headers);
     40 
     41  private:
     42   DISALLOW_COPY_AND_ASSIGN(SpdyUtils);
     43 };
     44 
     45 }  // namespace tools
     46 }  // namespace net
     47 
     48 #endif  // NET_TOOLS_QUIC_SPDY_UTILS_H_
     49