| OLD | NEW |
| 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 #include "net/spdy/spdy_protocol.h" | 5 #include "net/spdy/spdy_protocol.h" |
| 6 | 6 |
| 7 namespace net { | 7 namespace net { |
| 8 | 8 |
| 9 bool SpdyConstants::IsValidFrameType(SpdyMajorVersion version, | 9 bool SpdyConstants::IsValidFrameType(SpdyMajorVersion version, |
| 10 int frame_type_field) { | 10 int frame_type_field) { |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 } else { | 678 } else { |
| 679 // Max payload of 2^14 plus nine-byte frame header. | 679 // Max payload of 2^14 plus nine-byte frame header. |
| 680 // TODO(mlavan): In HTTP/2 this is actually not a constant; | 680 // TODO(mlavan): In HTTP/2 this is actually not a constant; |
| 681 // payload size can be set using the MAX_FRAME_SIZE setting to | 681 // payload size can be set using the MAX_FRAME_SIZE setting to |
| 682 // anything between 1 << 14 and (1 << 24) - 1 | 682 // anything between 1 << 14 and (1 << 24) - 1 |
| 683 return (1 << 14) + 9; | 683 return (1 << 14) + 9; |
| 684 } | 684 } |
| 685 } | 685 } |
| 686 | 686 |
| 687 size_t SpdyConstants::GetSizeOfSizeField(SpdyMajorVersion version) { | 687 size_t SpdyConstants::GetSizeOfSizeField(SpdyMajorVersion version) { |
| 688 return (version < SPDY3) ? sizeof(uint16) : sizeof(uint32); | 688 return (version < SPDY3) ? sizeof(uint16_t) : sizeof(uint32_t); |
| 689 } | 689 } |
| 690 | 690 |
| 691 size_t SpdyConstants::GetSettingSize(SpdyMajorVersion version) { | 691 size_t SpdyConstants::GetSettingSize(SpdyMajorVersion version) { |
| 692 return version <= SPDY3 ? 8 : 6; | 692 return version <= SPDY3 ? 8 : 6; |
| 693 } | 693 } |
| 694 | 694 |
| 695 int32 SpdyConstants::GetInitialStreamWindowSize(SpdyMajorVersion version) { | 695 int32_t SpdyConstants::GetInitialStreamWindowSize(SpdyMajorVersion version) { |
| 696 return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1); | 696 return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1); |
| 697 } | 697 } |
| 698 | 698 |
| 699 int32 SpdyConstants::GetInitialSessionWindowSize(SpdyMajorVersion version) { | 699 int32_t SpdyConstants::GetInitialSessionWindowSize(SpdyMajorVersion version) { |
| 700 return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1); | 700 return (version <= SPDY3) ? (64 * 1024) : (64 * 1024 - 1); |
| 701 } | 701 } |
| 702 | 702 |
| 703 SpdyMajorVersion SpdyConstants::ParseMajorVersion(int version_number) { | 703 SpdyMajorVersion SpdyConstants::ParseMajorVersion(int version_number) { |
| 704 switch (version_number) { | 704 switch (version_number) { |
| 705 case 2: | 705 case 2: |
| 706 return SPDY2; | 706 return SPDY2; |
| 707 case 3: | 707 case 3: |
| 708 return SPDY3; | 708 return SPDY3; |
| 709 case 4: | 709 case 4: |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 | 838 |
| 839 void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const { | 839 void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const { |
| 840 return visitor->VisitAltSvc(*this); | 840 return visitor->VisitAltSvc(*this); |
| 841 } | 841 } |
| 842 | 842 |
| 843 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { | 843 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { |
| 844 return visitor->VisitPriority(*this); | 844 return visitor->VisitPriority(*this); |
| 845 } | 845 } |
| 846 | 846 |
| 847 } // namespace net | 847 } // namespace net |
| OLD | NEW |