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

Unified Diff: net/spdy/spdy_protocol.cc

Issue 2130153002: Clean up max_frame_size related constants, move storage of setting to the framer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a typo in net/spdy/spdy_protocol.h. Created 4 years, 5 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_protocol.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_protocol.cc
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
index 8f3204e6cd99f7bfe73b8bdcbacad569e50c5bbb..8672eadaac8b8aa9cc7ce430cb8a736e2818a424 100644
--- a/net/spdy/spdy_protocol.cc
+++ b/net/spdy/spdy_protocol.cc
@@ -691,7 +691,7 @@ int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version,
return -1;
}
-size_t SpdyConstants::GetDataFrameMinimumSize(SpdyMajorVersion version) {
+size_t SpdyConstants::GetFrameHeaderSize(SpdyMajorVersion version) {
switch (version) {
case SPDY3:
return 8;
@@ -702,36 +702,21 @@ size_t SpdyConstants::GetDataFrameMinimumSize(SpdyMajorVersion version) {
return 0;
}
+size_t SpdyConstants::GetDataFrameMinimumSize(SpdyMajorVersion version) {
+ return GetFrameHeaderSize(version);
+}
+
size_t SpdyConstants::GetControlFrameHeaderSize(SpdyMajorVersion version) {
- switch (version) {
- case SPDY3:
- return 8;
- case HTTP2:
- return 9;
- }
- SPDY_BUG << "Unhandled SPDY version.";
- return 0;
+ return GetFrameHeaderSize(version);
}
size_t SpdyConstants::GetPrefixLength(SpdyFrameType type,
SpdyMajorVersion version) {
- if (type != DATA) {
- return GetControlFrameHeaderSize(version);
- } else {
- return GetDataFrameMinimumSize(version);
- }
+ return GetFrameHeaderSize(version);
}
-size_t SpdyConstants::GetFrameMaximumSize(SpdyMajorVersion version) {
- if (version == SPDY3) {
- // 24-bit length field plus eight-byte frame header.
- return ((1 << 24) - 1) + 8;
- } else {
- // Max payload of 2^14 plus nine-byte frame header.
- // TODO(dahollings): Change this to the actual spec
- // max of (1 << 24) - 1 + 9.
- return (1 << 14) + 9;
- }
+size_t SpdyConstants::GetMaxFrameSizeLimit(SpdyMajorVersion version) {
+ return kSpdyMaxFrameSizeLimit + GetFrameHeaderSize(version);
}
size_t SpdyConstants::GetSizeOfSizeField() {
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698