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

Unified Diff: net/spdy/spdy_protocol.cc

Issue 246013002: SPDY: Headers & Push-Promise now use Continuations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: net/spdy/spdy_protocol.cc
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
index a5445b7c8ec7c2e80762832ce7f6d0d54e52a949..2069f8e1aeccb45f39f27d47f4cdb57f5d734868 100644
--- a/net/spdy/spdy_protocol.cc
+++ b/net/spdy/spdy_protocol.cc
@@ -603,6 +603,40 @@ int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version,
}
}
+size_t SpdyConstants::GetDataFrameMinimumSize() {
+ return 8;
+}
+
+size_t SpdyConstants::GetControlFrameHeaderSize(SpdyMajorVersion version) {
+ switch (version) {
+ case SPDY2:
+ case SPDY3:
+ case SPDY4:
+ return 8;
+ }
+ LOG(DFATAL) << "Unhandled SPDY version.";
+ return 0;
+}
+
+size_t SpdyConstants::GetPrefixLength(SpdyFrameType type,
+ SpdyMajorVersion version) {
+ if (type != DATA) {
+ return GetControlFrameHeaderSize(version);
+ } else {
+ return GetDataFrameMinimumSize();
+ }
+}
+
+size_t SpdyConstants::GetFrameMaximumSize(SpdyMajorVersion version) {
+ if (version < SPDY4) {
+ // 24-bit length field plus eight-byte frame header.
+ return ((1<<24) - 1) + 8;
+ } else {
+ // 14-bit length field.
+ return (1<<14) - 1;
+ }
+}
+
void SpdyDataIR::Visit(SpdyFrameVisitor* visitor) const {
return visitor->VisitData(*this);
}

Powered by Google App Engine
This is Rietveld 408576698