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

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: Rebase only 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_protocol.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_protocol.cc
diff --git a/net/spdy/spdy_protocol.cc b/net/spdy/spdy_protocol.cc
index 9bf9672d09c16382e8bb2c4c4d445638c13b0606..b46e182bd67ee6e0eae911f11459791a6e991d5c 100644
--- a/net/spdy/spdy_protocol.cc
+++ b/net/spdy/spdy_protocol.cc
@@ -611,6 +611,40 @@ int SpdyConstants::SerializeGoAwayStatus(SpdyMajorVersion version,
return -1;
}
+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);
}
« no previous file with comments | « net/spdy/spdy_protocol.h ('k') | net/tools/quic/spdy_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698