| OLD | NEW |
| 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 <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame, | 22 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame, |
| 23 // populating |headers| with the key->value std:pairs found. | 23 // populating |headers| with the key->value std:pairs found. |
| 24 // |content_length| will be populated with the value of the content-length | 24 // |content_length| will be populated with the value of the content-length |
| 25 // header if one or more are present. | 25 // header if one or more are present. |
| 26 // Returns true on success, false if parsing fails, or invalid keys are found. | 26 // Returns true on success, false if parsing fails, or invalid keys are found. |
| 27 static bool ParseHeaders(const char* data, | 27 static bool ParseHeaders(const char* data, |
| 28 uint32 data_len, | 28 uint32 data_len, |
| 29 int* content_length, | 29 int* content_length, |
| 30 SpdyHeaderBlock* headers); | 30 SpdyHeaderBlock* headers); |
| 31 | 31 |
| 32 // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame, |
| 33 // populating |trailers| with the key->value std:pairs found. |
| 34 // The :final-offset header will be excluded from |trailers|, and instead the |
| 35 // value will be copied to |final_byte_offset|. |
| 36 // Returns true on success, false if parsing fails, or invalid keys are found. |
| 37 static bool ParseTrailers(const char* data, |
| 38 uint32 data_len, |
| 39 size_t* final_byte_offset, |
| 40 SpdyHeaderBlock* trailers); |
| 41 |
| 32 private: | 42 private: |
| 33 DISALLOW_COPY_AND_ASSIGN(SpdyUtils); | 43 DISALLOW_COPY_AND_ASSIGN(SpdyUtils); |
| 34 }; | 44 }; |
| 35 | 45 |
| 36 } // namespace net | 46 } // namespace net |
| 37 | 47 |
| 38 #endif // NET_QUIC_SPDY_UTILS_H_ | 48 #endif // NET_QUIC_SPDY_UTILS_H_ |
| OLD | NEW |