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

Unified Diff: net/quic/spdy_utils.h

Issue 1494403002: Adds a ParseTrailers method to SpdyUtils, with some basic validation of the header keys provided. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108694474
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/spdy_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/spdy_utils.h
diff --git a/net/quic/spdy_utils.h b/net/quic/spdy_utils.h
index 87fa0087a77964faabc8dae1230e7f047b2712a2..76b667dd6716bdc9b527f8da17127428c5fc8aea 100644
--- a/net/quic/spdy_utils.h
+++ b/net/quic/spdy_utils.h
@@ -29,6 +29,16 @@ class NET_EXPORT_PRIVATE SpdyUtils {
int* content_length,
SpdyHeaderBlock* headers);
+ // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame,
+ // populating |trailers| with the key->value std:pairs found.
+ // The :final-offset header will be excluded from |trailers|, and instead the
+ // value will be copied to |final_byte_offset|.
+ // Returns true on success, false if parsing fails, or invalid keys are found.
+ static bool ParseTrailers(const char* data,
+ uint32 data_len,
+ size_t* final_byte_offset,
+ SpdyHeaderBlock* trailers);
+
private:
DISALLOW_COPY_AND_ASSIGN(SpdyUtils);
};
« no previous file with comments | « no previous file | net/quic/spdy_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698