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

Unified Diff: net/quic/core/spdy_utils.cc

Issue 2363393004: Remove usage of BalsaHeaders from QuicClient. Also move QuicDataToResend from QuicClient to QuicCli… (Closed)
Patch Set: Fix win Created 4 years, 3 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/quic/core/spdy_utils.h ('k') | net/quic/core/spdy_utils_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/spdy_utils.cc
diff --git a/net/quic/core/spdy_utils.cc b/net/quic/core/spdy_utils.cc
index 987a3a1a9c46cf66a24a5751c91b9141a34c262c..64b781dbaddb43e15571c582624dbad85ea9e604 100644
--- a/net/quic/core/spdy_utils.cc
+++ b/net/quic/core/spdy_utils.cc
@@ -242,4 +242,23 @@ bool SpdyUtils::UrlIsValid(const SpdyHeaderBlock& headers) {
return url != "" && GURL(url).is_valid();
}
+// static
+bool SpdyUtils::PopulateHeaderBlockFromUrl(const string url,
+ SpdyHeaderBlock* headers) {
+ (*headers)[":method"] = "GET";
+ size_t pos = url.find("://");
+ if (pos == string::npos) {
+ return false;
+ }
+ (*headers)[":scheme"] = url.substr(0, pos);
+ size_t start = pos + 3;
+ pos = url.find("/", start);
+ if (pos == string::npos) {
+ return false;
+ }
+ (*headers)[":authority"] = url.substr(start, pos - start);
+ (*headers)[":path"] = url.substr(pos);
+ return true;
+}
+
} // namespace net
« no previous file with comments | « net/quic/core/spdy_utils.h ('k') | net/quic/core/spdy_utils_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698