Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: net/quic/spdy_utils.h

Issue 1870833005: relnote: Implements OnHeaderFrameStart and OnHeaderFrameEnd in QuicHeadersStream. Not used in produ… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@06_CL_119188441
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_QUIC_SPDY_UTILS_H_ 5 #ifndef NET_QUIC_SPDY_UTILS_H_
6 #define NET_QUIC_SPDY_UTILS_H_ 6 #define NET_QUIC_SPDY_UTILS_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <string> 12 #include <string>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "net/base/net_export.h" 15 #include "net/base/net_export.h"
16 #include "net/quic/quic_header_list.h"
16 #include "net/quic/quic_protocol.h" 17 #include "net/quic/quic_protocol.h"
17 #include "net/spdy/spdy_framer.h" 18 #include "net/spdy/spdy_framer.h"
18 19
19 namespace net { 20 namespace net {
20 21
21 class NET_EXPORT_PRIVATE SpdyUtils { 22 class NET_EXPORT_PRIVATE SpdyUtils {
22 public: 23 public:
23 static std::string SerializeUncompressedHeaders( 24 static std::string SerializeUncompressedHeaders(
24 const SpdyHeaderBlock& headers); 25 const SpdyHeaderBlock& headers);
25 26
(...skipping 10 matching lines...) Expand all
36 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame, 37 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame,
37 // populating |trailers| with the key->value std:pairs found. 38 // populating |trailers| with the key->value std:pairs found.
38 // The final offset header will be excluded from |trailers|, and instead the 39 // The final offset header will be excluded from |trailers|, and instead the
39 // value will be copied to |final_byte_offset|. 40 // value will be copied to |final_byte_offset|.
40 // Returns true on success, false if parsing fails, or invalid keys are found. 41 // Returns true on success, false if parsing fails, or invalid keys are found.
41 static bool ParseTrailers(const char* data, 42 static bool ParseTrailers(const char* data,
42 uint32_t data_len, 43 uint32_t data_len,
43 size_t* final_byte_offset, 44 size_t* final_byte_offset,
44 SpdyHeaderBlock* trailers); 45 SpdyHeaderBlock* trailers);
45 46
47 // Copies a list of headers to a SpdyHeaderBlock. Performs similar validation
48 // to SpdyFramer::ParseHeaderBlockInBuffer.
49 static bool CopyAndValidateTrailers(const QuicHeaderList& header_list,
50 size_t* final_byte_offset,
51 SpdyHeaderBlock* trailers);
52
46 // Returns URL composed from scheme, authority, and path header 53 // Returns URL composed from scheme, authority, and path header
47 // values, or empty string if any of those fields are missing. 54 // values, or empty string if any of those fields are missing.
48 static std::string GetUrlFromHeaderBlock(const net::SpdyHeaderBlock& headers); 55 static std::string GetUrlFromHeaderBlock(const net::SpdyHeaderBlock& headers);
49 56
50 // Returns hostname, or empty std::string if missing. 57 // Returns hostname, or empty std::string if missing.
51 static std::string GetHostNameFromHeaderBlock(const SpdyHeaderBlock& headers); 58 static std::string GetHostNameFromHeaderBlock(const SpdyHeaderBlock& headers);
52 59
53 // Returns true if result of |GetUrlFromHeaderBlock()| is non-empty 60 // Returns true if result of |GetUrlFromHeaderBlock()| is non-empty
54 // and is a well-formed URL. 61 // and is a well-formed URL.
55 static bool UrlIsValid(const net::SpdyHeaderBlock& headers); 62 static bool UrlIsValid(const net::SpdyHeaderBlock& headers);
56 63
57 private: 64 private:
58 DISALLOW_COPY_AND_ASSIGN(SpdyUtils); 65 DISALLOW_COPY_AND_ASSIGN(SpdyUtils);
59 }; 66 };
60 67
61 } // namespace net 68 } // namespace net
62 69
63 #endif // NET_QUIC_SPDY_UTILS_H_ 70 #endif // NET_QUIC_SPDY_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698