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

Unified Diff: net/spdy/spdy_protocol.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
Index: net/spdy/spdy_protocol.cc
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
index a0e83132d039411838708adf3bb71e5d6b4f2d41..3993c0125ccb5bb66aaf1e7903f797f31114c190 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.";
@@ -778,6 +757,14 @@ size_t SpdyConstants::GetSettingSize(SpdyMajorVersion version) {
return version <= SPDY3 ? 8 : 6;
}
+int32 SpdyConstants::GetInitialStreamWindowSize(SpdyMajorVersion version) {
+ return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
+}
+
+int32 SpdyConstants::GetInitialSessionWindowSize(SpdyMajorVersion version) {
+ return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1);
+}
+
void SpdyDataIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitData(*this);
}
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/spdy/spdy_session.h » ('j') | shell/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698