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

Unified Diff: net/spdy/spdy_test_util_common.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
Index: net/spdy/spdy_test_util_common.cc
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 801d67d2a676a31ed80e5399f12e25c53db7ce4a..9543e64260b56c1363934a0d4d806834594c638b 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -54,8 +54,6 @@ void ParseUrl(base::StringPiece url, std::string* scheme, std::string* host,
NextProtoVector SpdyNextProtos() {
NextProtoVector next_protos;
next_protos.push_back(kProtoHTTP11);
- next_protos.push_back(kProtoDeprecatedSPDY2);
- next_protos.push_back(kProtoSPDY3);
next_protos.push_back(kProtoSPDY31);
next_protos.push_back(kProtoSPDY4_14);
next_protos.push_back(kProtoSPDY4_15);
@@ -720,15 +718,11 @@ SpdyTestUtil::SpdyTestUtil(NextProto protocol)
void SpdyTestUtil::AddUrlToHeaderBlock(base::StringPiece url,
SpdyHeaderBlock* headers) const {
- if (is_spdy2()) {
- (*headers)["url"] = url.as_string();
- } else {
- std::string scheme, host, path;
- ParseUrl(url, &scheme, &host, &path);
- (*headers)[GetSchemeKey()] = scheme;
- (*headers)[GetHostKey()] = host;
- (*headers)[GetPathKey()] = path;
- }
+ std::string scheme, host, path;
+ ParseUrl(url, &scheme, &host, &path);
+ (*headers)[GetSchemeKey()] = scheme;
+ (*headers)[GetHostKey()] = host;
+ (*headers)[GetPathKey()] = path;
}
scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructGetHeaderBlock(
@@ -739,8 +733,6 @@ scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructGetHeaderBlock(
scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructGetHeaderBlockForProxy(
base::StringPiece url) const {
scoped_ptr<SpdyHeaderBlock> headers(ConstructGetHeaderBlock(url));
- if (is_spdy2())
- (*headers)[GetPathKey()] = url.data();
return headers.Pass();
}
@@ -963,8 +955,7 @@ SpdyFrame* SpdyTestUtil::ConstructSpdyGet(const char* const extra_headers[],
bool direct) const {
SpdyHeaderBlock block;
block[GetMethodKey()] = "GET";
- block[GetPathKey()] =
- (is_spdy2() && !direct) ? "http://www.google.com/" : "/";
+ block[GetPathKey()] = "/";
block[GetHostKey()] = "www.google.com";
block[GetSchemeKey()] = "http";
MaybeAddVersionHeader(&block);
@@ -1259,16 +1250,14 @@ scoped_ptr<SpdyFramer> SpdyTestUtil::CreateFramer(bool compressed) const {
}
const char* SpdyTestUtil::GetMethodKey() const {
- return is_spdy2() ? "method" : ":method";
+ return ":method";
}
const char* SpdyTestUtil::GetStatusKey() const {
- return is_spdy2() ? "status" : ":status";
+ return ":status";
}
const char* SpdyTestUtil::GetHostKey() const {
- if (protocol_ < kProtoSPDY3)
- return "host";
if (protocol_ < kProtoSPDY4MinimumVersion)
return ":host";
else
@@ -1276,15 +1265,15 @@ const char* SpdyTestUtil::GetHostKey() const {
}
const char* SpdyTestUtil::GetSchemeKey() const {
- return is_spdy2() ? "scheme" : ":scheme";
+ return ":scheme";
}
const char* SpdyTestUtil::GetVersionKey() const {
- return is_spdy2() ? "version" : ":version";
+ return ":version";
}
const char* SpdyTestUtil::GetPathKey() const {
- return is_spdy2() ? "url" : ":path";
+ return ":path";
}
scoped_ptr<SpdyHeaderBlock> SpdyTestUtil::ConstructHeaderBlock(
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698