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

Unified Diff: net/spdy/spdy_http_utils.cc

Issue 1692253004: QUIC - chromium server push support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback round 2. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_http_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_http_utils.cc
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc
index 7bf46b614e3cfd455fe0829da9b359a4eee4ad6d..573bce18b8f893b1ba15fb0fa8c5dd759ea625db 100644
--- a/net/spdy/spdy_http_utils.cc
+++ b/net/spdy/spdy_http_utils.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "net/base/escape.h"
@@ -192,6 +193,22 @@ NET_EXPORT_PRIVATE RequestPriority ConvertSpdyPriorityToRequestPriority(
IDLE : static_cast<RequestPriority>(4 - priority);
}
+NET_EXPORT_PRIVATE void ConvertHeaderBlockToHttpRequestHeaders(
+ const SpdyHeaderBlock& spdy_headers,
+ HttpRequestHeaders* http_headers) {
+ for (const auto& it : spdy_headers) {
+ base::StringPiece key = it.first;
+ if (key[0] == ':') {
+ key.remove_prefix(1);
+ }
+ std::vector<base::StringPiece> values = base::SplitStringPiece(
+ it.second, "\0", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ for (const auto& value : values) {
+ http_headers->SetHeader(key, value);
+ }
+ }
+}
+
GURL GetUrlFromHeaderBlock(const SpdyHeaderBlock& headers,
SpdyMajorVersion protocol_version) {
SpdyHeaderBlock::const_iterator it = headers.find(":scheme");
« no previous file with comments | « net/spdy/spdy_http_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698