From 5e579be703cd6c50db44ce478e78ea48a2632031 Mon Sep 17 00:00:00 2001 From: bnc Date: Tue, 20 Jan 2015 12:35:06 -0800 Subject: [PATCH] Delete SPDY5. SPDY5 is not actively used in production, it is not supported as a first class protocol. This lands server change 81897859 by birenroy. BUG=345769 Review URL: https://codereview.chromium.org/854223002 Cr-Commit-Position: refs/heads/master@{#312263} --- net/spdy/spdy_framer_test.cc | 3 +-- net/spdy/spdy_protocol.cc | 23 +---------------------- net/spdy/spdy_protocol.h | 4 ++-- net/spdy/spdy_session_unittest.cc | 4 ---- net/spdy/spdy_test_utils.cc | 2 -- 5 files changed, 4 insertions(+), 32 deletions(-) diff --git a/net/spdy/spdy_framer_test.cc b/net/spdy/spdy_framer_test.cc index 0c9c5c168f2c..c2979131cf9d 100644 --- a/net/spdy/spdy_framer_test.cc +++ b/net/spdy/spdy_framer_test.cc @@ -668,7 +668,6 @@ class SpdyFramerTest : public ::testing::TestWithParam { bool IsSpdy2() { return spdy_version_ == SPDY2; } bool IsSpdy3() { return spdy_version_ == SPDY3; } bool IsSpdy4() { return spdy_version_ == SPDY4; } - bool IsSpdy5() { return spdy_version_ == SPDY5; } // Version of SPDY protocol to be used. SpdyMajorVersion spdy_version_; @@ -4675,7 +4674,7 @@ TEST_P(SpdyFramerTest, ReadGarbageHPACKEncoding) { TEST_P(SpdyFramerTest, SizesTest) { SpdyFramer framer(spdy_version_); - if (IsSpdy4() || IsSpdy5()) { + if (IsSpdy4()) { EXPECT_EQ(9u, framer.GetDataFrameMinimumSize()); EXPECT_EQ(9u, framer.GetControlFrameHeaderSize()); EXPECT_EQ(14u, framer.GetSynStreamMinimumSize()); diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc index 34af7e48a34b..3993c0125ccb 100644 --- a/net/spdy/spdy_protocol.cc +++ b/net/spdy/spdy_protocol.cc @@ -42,7 +42,6 @@ bool SpdyConstants::IsValidFrameType(SpdyMajorVersion version, return true; case SPDY4: - case SPDY5: // Check for recognized extensions. if (frame_type_field == SerializeFrameType(version, ALTSVC) || frame_type_field == SerializeFrameType(version, BLOCKED)) { @@ -91,7 +90,6 @@ SpdyFrameType SpdyConstants::ParseFrameType(SpdyMajorVersion version, } break; case SPDY4: - case SPDY5: switch (frame_type_field) { case 0: return DATA; @@ -152,7 +150,6 @@ int SpdyConstants::SerializeFrameType(SpdyMajorVersion version, return -1; } case SPDY4: - case SPDY5: switch (frame_type) { case DATA: return 0; @@ -195,7 +192,6 @@ int SpdyConstants::DataFrameType(SpdyMajorVersion version) { case SPDY3: return 0; case SPDY4: - case SPDY5: return SerializeFrameType(version, DATA); } @@ -222,7 +218,6 @@ bool SpdyConstants::IsValidSettingId(SpdyMajorVersion version, return true; case SPDY4: - case SPDY5: // HEADER_TABLE_SIZE is the first valid setting id. if (setting_id_field < SerializeSettingId(version, SETTINGS_HEADER_TABLE_SIZE)) { @@ -265,7 +260,6 @@ SpdySettingsIds SpdyConstants::ParseSettingId(SpdyMajorVersion version, } break; case SPDY4: - case SPDY5: switch (setting_id_field) { case 1: return SETTINGS_HEADER_TABLE_SIZE; @@ -312,7 +306,6 @@ int SpdyConstants::SerializeSettingId(SpdyMajorVersion version, return -1; } case SPDY4: - case SPDY5: switch (id) { case SETTINGS_HEADER_TABLE_SIZE: return 1; @@ -354,7 +347,6 @@ bool SpdyConstants::IsValidRstStreamStatus(SpdyMajorVersion version, return true; case SPDY4: - case SPDY5: // NO_ERROR is the first valid status code. if (rst_stream_status_field < SerializeRstStreamStatus(version, RST_STREAM_PROTOCOL_ERROR)) { @@ -416,7 +408,6 @@ SpdyRstStreamStatus SpdyConstants::ParseRstStreamStatus( } break; case SPDY4: - case SPDY5: switch (rst_stream_status_field) { case 1: return RST_STREAM_PROTOCOL_ERROR; @@ -483,7 +474,6 @@ int SpdyConstants::SerializeRstStreamStatus( return -1; } case SPDY4: - case SPDY5: switch (rst_stream_status) { case RST_STREAM_PROTOCOL_ERROR: return 1; @@ -535,7 +525,6 @@ bool SpdyConstants::IsValidGoAwayStatus(SpdyMajorVersion version, return true; case SPDY4: - case SPDY5: // GOAWAY_NO_ERROR is the first valid status. if (goaway_status_field < SerializeGoAwayStatus(version, GOAWAY_NO_ERROR)) { @@ -569,7 +558,6 @@ SpdyGoAwayStatus SpdyConstants::ParseGoAwayStatus(SpdyMajorVersion version, } break; case SPDY4: - case SPDY5: switch (goaway_status_field) { case 0: return GOAWAY_NO_ERROR; @@ -615,8 +603,6 @@ SpdyMajorVersion SpdyConstants::ParseMajorVersion(int version_number) { return SPDY3; case 4: return SPDY4; - case 5: - return SPDY5; default: LOG(DFATAL) << "Unsupported SPDY version number: " << version_number; return SPDY3; @@ -631,8 +617,6 @@ int SpdyConstants::SerializeMajorVersion(SpdyMajorVersion version) { return 3; case SPDY4: return 4; - case SPDY5: - return 5; default: LOG(DFATAL) << "Unsupported SPDY major version: " << version; return -1; @@ -646,9 +630,7 @@ std::string SpdyConstants::GetVersionString(SpdyMajorVersion version) { case SPDY3: return "spdy/3"; case SPDY4: - return "spdy/4"; - case SPDY5: - return "spdy/5"; + return "h2-14"; default: LOG(DFATAL) << "Unsupported SPDY major version: " << version; return "spdy/3"; @@ -683,7 +665,6 @@ int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version, return -1; } case SPDY4: - case SPDY5: switch (status) { case GOAWAY_NO_ERROR: return 0; @@ -728,7 +709,6 @@ size_t SpdyConstants::GetDataFrameMinimumSize(SpdyMajorVersion version) { case SPDY3: return 8; case SPDY4: - case SPDY5: return 9; } LOG(DFATAL) << "Unhandled SPDY version."; @@ -741,7 +721,6 @@ size_t SpdyConstants::GetControlFrameHeaderSize(SpdyMajorVersion version) { case SPDY3: return 8; case SPDY4: - case SPDY5: return 9; } LOG(DFATAL) << "Unhandled SPDY version."; diff --git a/net/spdy/spdy_protocol.h b/net/spdy/spdy_protocol.h index 410bf2208d51..80f46d7745c8 100644 --- a/net/spdy/spdy_protocol.h +++ b/net/spdy/spdy_protocol.h @@ -36,8 +36,8 @@ enum SpdyMajorVersion { SPDY_MIN_VERSION = SPDY2, SPDY3 = 3, SPDY4 = 4, - SPDY5 = 5, - SPDY_MAX_VERSION = SPDY5 + HTTP2 = SPDY4, + SPDY_MAX_VERSION = SPDY4 }; // A SPDY stream id is a 31 bit entity. diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc index c5398fc65fc8..ba3cb611ac84 100644 --- a/net/spdy/spdy_session_unittest.cc +++ b/net/spdy/spdy_session_unittest.cc @@ -1808,10 +1808,6 @@ TEST_P(SpdySessionTest, SynCompressionHistograms) { histogram_tester.ExpectBucketCount( "Net.SpdySynStreamCompressionPercentage", 82, 1); break; - case SPDY5: - histogram_tester.ExpectBucketCount( - "Net.SpdySynStreamCompressionPercentage", 82, 1); - break; default: NOTREACHED(); } diff --git a/net/spdy/spdy_test_utils.cc b/net/spdy/spdy_test_utils.cc index 6c1396298d51..8ea16c8a69f1 100644 --- a/net/spdy/spdy_test_utils.cc +++ b/net/spdy/spdy_test_utils.cc @@ -95,7 +95,6 @@ void SetFrameFlags(SpdyFrame* frame, case SPDY2: case SPDY3: case SPDY4: - case SPDY5: frame->data()[4] = flags; break; default: @@ -118,7 +117,6 @@ void SetFrameLength(SpdyFrame* frame, } break; case SPDY4: - case SPDY5: CHECK_GT(1u<<14, length); { int32 wire_length = base::HostToNet32(length); -- 2.11.4.GIT