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

Unified Diff: net/quic/spdy_utils.h

Issue 1501493003: Pull HTTP/2 header parsing into utility method, from QuicSpdy{Client,Server}Streams. Not used in pr… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108651883
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 28b48dbe5d900175f4bd85208f1a901fef2896b4..87fa0087a77964faabc8dae1230e7f047b2712a2 100644
--- a/net/quic/spdy_utils.h
+++ b/net/quic/spdy_utils.h
@@ -5,6 +5,7 @@
#ifndef NET_QUIC_SPDY_UTILS_H_
#define NET_QUIC_SPDY_UTILS_H_
+#include <map>
#include <string>
#include "net/base/net_export.h"
@@ -18,6 +19,16 @@ class NET_EXPORT_PRIVATE SpdyUtils {
static std::string SerializeUncompressedHeaders(
const SpdyHeaderBlock& headers);
+ // Parses |data| as a std::string containing serialized HTTP/2 HEADERS frame,
+ // populating |headers| with the key->value std:pairs found.
+ // |content_length| will be populated with the value of the content-length
+ // header if one or more are present.
+ // Returns true on success, false if parsing fails, or invalid keys are found.
+ static bool ParseHeaders(const char* data,
+ uint32 data_len,
+ int* content_length,
+ SpdyHeaderBlock* headers);
+
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