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

Side by Side Diff: net/spdy/spdy_protocol.h

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 unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file contains some protocol structures for use with SPDY 3 and HTTP 2 5 // This file contains some protocol structures for use with SPDY 3 and HTTP 2
6 // The SPDY 3 spec can be found at: 6 // The SPDY 3 spec can be found at:
7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3 7 // http://dev.chromium.org/spdy/spdy-protocol/spdy-protocol-draft3
8 8
9 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ 9 #ifndef NET_SPDY_SPDY_PROTOCOL_H_
10 #define NET_SPDY_SPDY_PROTOCOL_H_ 10 #define NET_SPDY_SPDY_PROTOCOL_H_
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // 15 bit version field for SPDY/3 frames. 43 // 15 bit version field for SPDY/3 frames.
44 const uint16_t kSpdy3Version = 3; 44 const uint16_t kSpdy3Version = 3;
45 45
46 // A SPDY stream id is a 31 bit entity. 46 // A SPDY stream id is a 31 bit entity.
47 typedef uint32_t SpdyStreamId; 47 typedef uint32_t SpdyStreamId;
48 48
49 // Specifies the stream ID used to denote the current session (for 49 // Specifies the stream ID used to denote the current session (for
50 // flow control). 50 // flow control).
51 const SpdyStreamId kSessionFlowControlStreamId = 0; 51 const SpdyStreamId kSessionFlowControlStreamId = 0;
52 52
53 // The maxmium possible frame payload size allowed by the spec. 53 // The maximum possible frame payload size allowed by the spec.
54 const uint32_t kSpdyMaxFrameSizeLimit = (1 << 24) - 1; 54 const uint32_t kSpdyMaxFrameSizeLimit = (1 << 24) - 1;
55 55
56 // The initial value for the maximum frame payload size as per the spec. This is 56 // The initial value for the maximum frame payload size as per the spec. This is
57 // the maximum control frame size we accept. 57 // the maximum control frame size we accept.
58 const uint32_t kSpdyInitialFrameSizeLimit = 1 << 14; 58 const uint32_t kSpdyInitialFrameSizeLimit = 1 << 14;
59 59
60 // The initial value for the maximum size of the header list, "unlimited" (max 60 // The initial value for the maximum size of the header list, "unlimited" (max
61 // unsigned 32-bit int) as per the spec. 61 // unsigned 32-bit int) as per the spec.
62 const uint32_t kSpdyInitialHeaderListSizeLimit = 0xFFFFFFFF; 62 const uint32_t kSpdyInitialHeaderListSizeLimit = 0xFFFFFFFF;
63 63
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 // the given protocol version. 525 // the given protocol version.
526 // Returns -1 on failure (I.E. Invalid GOAWAY status for the given version). 526 // Returns -1 on failure (I.E. Invalid GOAWAY status for the given version).
527 static int SerializeGoAwayStatus(SpdyMajorVersion version, 527 static int SerializeGoAwayStatus(SpdyMajorVersion version,
528 SpdyGoAwayStatus status); 528 SpdyGoAwayStatus status);
529 529
530 // Size, in bytes, of the data frame header. Future versions of SPDY 530 // Size, in bytes, of the data frame header. Future versions of SPDY
531 // will likely vary this, so we allow for the flexibility of a function call 531 // will likely vary this, so we allow for the flexibility of a function call
532 // for this value as opposed to a constant. 532 // for this value as opposed to a constant.
533 static size_t GetDataFrameMinimumSize(SpdyMajorVersion version); 533 static size_t GetDataFrameMinimumSize(SpdyMajorVersion version);
534 534
535 // Number of octets in the frame header
536 static size_t GetFrameHeaderSize(SpdyMajorVersion version);
537
535 // Size, in bytes, of the control frame header. 538 // Size, in bytes, of the control frame header.
536 static size_t GetControlFrameHeaderSize(SpdyMajorVersion version); 539 static size_t GetControlFrameHeaderSize(SpdyMajorVersion version);
537 540
538 static size_t GetPrefixLength(SpdyFrameType type, SpdyMajorVersion version); 541 static size_t GetPrefixLength(SpdyFrameType type, SpdyMajorVersion version);
539 542
540 static size_t GetFrameMaximumSize(SpdyMajorVersion version); 543 // Maximum possible configurable size of a frame in octets.
544 static size_t GetMaxFrameSizeLimit(SpdyMajorVersion version);
541 545
542 // Returns the size of a header block size field. Valid only for SPDY 3. 546 // Returns the size of a header block size field. Valid only for SPDY 3.
543 static size_t GetSizeOfSizeField(); 547 static size_t GetSizeOfSizeField();
544 548
545 // Returns the per-header overhead for block size accounting in bytes. 549 // Returns the per-header overhead for block size accounting in bytes.
546 static size_t GetPerHeaderOverhead(SpdyMajorVersion version); 550 static size_t GetPerHeaderOverhead(SpdyMajorVersion version);
547 551
548 // Returns the size (in bytes) of a wire setting ID and value. 552 // Returns the size (in bytes) of a wire setting ID and value.
549 static size_t GetSettingSize(SpdyMajorVersion version); 553 static size_t GetSettingSize(SpdyMajorVersion version);
550 554
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 SpdyFrameVisitor() {} 1234 SpdyFrameVisitor() {}
1231 virtual ~SpdyFrameVisitor() {} 1235 virtual ~SpdyFrameVisitor() {}
1232 1236
1233 private: 1237 private:
1234 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor); 1238 DISALLOW_COPY_AND_ASSIGN(SpdyFrameVisitor);
1235 }; 1239 };
1236 1240
1237 } // namespace net 1241 } // namespace net
1238 1242
1239 #endif // NET_SPDY_SPDY_PROTOCOL_H_ 1243 #endif // NET_SPDY_SPDY_PROTOCOL_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_framer.cc ('k') | net/spdy/spdy_protocol.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698