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

Unified Diff: net/spdy/spdy_test_utils.cc

Issue 2515143002: Removing SPDY3 from the code base. (Closed)
Patch Set: Addressed a failure on windows. Created 4 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
« net/spdy/spdy_framer_test.cc ('K') | « net/spdy/spdy_protocol.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_utils.cc
diff --git a/net/spdy/spdy_test_utils.cc b/net/spdy/spdy_test_utils.cc
index e2c327eec2251fc1ace8d4f078d5f75859f1dec0..23d19883cf8ea7fc7b8bf610595e5ca3cf221d82 100644
--- a/net/spdy/spdy_test_utils.cc
+++ b/net/spdy/spdy_test_utils.cc
@@ -95,40 +95,16 @@ void CompareCharArraysWithHexError(const string& description,
void SetFrameFlags(SpdySerializedFrame* frame,
uint8_t flags,
SpdyMajorVersion spdy_version) {
- switch (spdy_version) {
- case SPDY3:
- case HTTP2:
- frame->data()[4] = flags;
- break;
- default:
- LOG(FATAL) << "Unsupported SPDY version.";
- }
+ frame->data()[4] = flags;
}
void SetFrameLength(SpdySerializedFrame* frame,
size_t length,
SpdyMajorVersion spdy_version) {
- switch (spdy_version) {
- case SPDY3:
- CHECK_EQ(0u, length & ~kLengthMask);
- {
- int32_t wire_length = base::HostToNet32(length);
- // The length field in SPDY 3 is a 24-bit (3B) integer starting at
- // offset 5.
- memcpy(frame->data() + 5, reinterpret_cast<char*>(&wire_length) + 1, 3);
- }
- break;
- case HTTP2:
- CHECK_GT(1u<<14, length);
- {
- int32_t wire_length = base::HostToNet32(length);
- memcpy(frame->data(),
- reinterpret_cast<char*>(&wire_length) + 1,
- 3);
- }
- break;
- default:
- LOG(FATAL) << "Unsupported SPDY version.";
+ CHECK_GT(1u << 14, length);
+ {
+ int32_t wire_length = base::HostToNet32(length);
+ memcpy(frame->data(), reinterpret_cast<char*>(&wire_length) + 1, 3);
}
}
« net/spdy/spdy_framer_test.cc ('K') | « net/spdy/spdy_protocol.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698