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

Unified Diff: net/spdy/spdy_test_utils.cc

Issue 246073007: SPDY & HPACK: Land recent internal changes (through 65328503) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on upstream change: Expanded FRAME_TOO_LARGE/FRAME_SIZE_ERROR comment. Created 6 years, 8 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_test_utils.h ('k') | net/tools/quic/spdy_utils.cc » ('j') | 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 e4063ea10dbd50ad33d0c6fd3a7234a37b0b4ab0..a7cfc901fbd93ed3e24298a30043f02c05a53d43 100644
--- a/net/spdy/spdy_test_utils.cc
+++ b/net/spdy/spdy_test_utils.cc
@@ -83,13 +83,16 @@ void CompareCharArraysWithHexError(
<< HexDumpWithMarks(actual, actual_len, marks.get(), max_len);
}
-void SetFrameFlags(SpdyFrame* frame, uint8 flags, int spdy_version) {
+void SetFrameFlags(SpdyFrame* frame,
+ uint8 flags,
+ SpdyMajorVersion spdy_version) {
switch (spdy_version) {
- case 2:
- case 3:
+ case SPDY2:
+ case SPDY3:
frame->data()[4] = flags;
break;
- case 4:
+ case SPDY4:
+ case SPDY5:
frame->data()[3] = flags;
break;
default:
@@ -97,10 +100,12 @@ void SetFrameFlags(SpdyFrame* frame, uint8 flags, int spdy_version) {
}
}
-void SetFrameLength(SpdyFrame* frame, size_t length, int spdy_version) {
+void SetFrameLength(SpdyFrame* frame,
+ size_t length,
+ SpdyMajorVersion spdy_version) {
switch (spdy_version) {
- case 2:
- case 3:
+ case SPDY2:
+ case SPDY3:
CHECK_EQ(0u, length & ~kLengthMask);
{
int32 wire_length = base::HostToNet32(length);
@@ -109,7 +114,8 @@ void SetFrameLength(SpdyFrame* frame, size_t length, int spdy_version) {
memcpy(frame->data() + 5, reinterpret_cast<char*>(&wire_length) + 1, 3);
}
break;
- case 4:
+ case SPDY4:
+ case SPDY5:
CHECK_GT(1u<<14, length);
{
int32 wire_length = base::HostToNet16(static_cast<uint16>(length));
« no previous file with comments | « net/spdy/spdy_test_utils.h ('k') | net/tools/quic/spdy_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698