| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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. | 5 // This file contains some protocol structures for use with Spdy. |
| 6 | 6 |
| 7 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ | 7 #ifndef NET_SPDY_SPDY_PROTOCOL_H_ |
| 8 #define NET_SPDY_SPDY_PROTOCOL_H_ | 8 #define NET_SPDY_SPDY_PROTOCOL_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 DCHECK(type >= SYN_STREAM && type < NUM_CONTROL_FRAME_TYPES); | 463 DCHECK(type >= SYN_STREAM && type < NUM_CONTROL_FRAME_TYPES); |
| 464 mutable_block()->control_.type_ = htons(type); | 464 mutable_block()->control_.type_ = htons(type); |
| 465 } | 465 } |
| 466 | 466 |
| 467 // Returns true if this control frame is of a type that has a header block, | 467 // Returns true if this control frame is of a type that has a header block, |
| 468 // otherwise it returns false. | 468 // otherwise it returns false. |
| 469 bool has_header_block() const { | 469 bool has_header_block() const { |
| 470 return type() == SYN_STREAM || type() == SYN_REPLY || type() == HEADERS; | 470 return type() == SYN_STREAM || type() == SYN_REPLY || type() == HEADERS; |
| 471 } | 471 } |
| 472 | 472 |
| 473 // Returns the size of the SpdyFrameBlock structure. | |
| 474 // Note: this is not the size of the SpdyControlFrame class. | |
| 475 static size_t size() { return sizeof(SpdyFrameBlock); } | |
| 476 | |
| 477 // The size of the 'Number of Name/Value pairs' field in a Name/Value block. | 473 // The size of the 'Number of Name/Value pairs' field in a Name/Value block. |
| 478 static const size_t kNumNameValuePairsSize = 2; | 474 static const size_t kNumNameValuePairsSize = 2; |
| 479 | 475 |
| 480 // The size of the 'Length of a name' field in a Name/Value block. | 476 // The size of the 'Length of a name' field in a Name/Value block. |
| 481 static const size_t kLengthOfNameSize = 2; | 477 static const size_t kLengthOfNameSize = 2; |
| 482 | 478 |
| 483 // The size of the 'Length of a value' field in a Name/Value block. | 479 // The size of the 'Length of a value' field in a Name/Value block. |
| 484 static const size_t kLengthOfValueSize = 2; | 480 static const size_t kLengthOfValueSize = 2; |
| 485 | 481 |
| 486 private: | 482 private: |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 struct SpdyWindowUpdateControlFrameBlock* mutable_block() { | 785 struct SpdyWindowUpdateControlFrameBlock* mutable_block() { |
| 790 return static_cast<SpdyWindowUpdateControlFrameBlock*>(frame_); | 786 return static_cast<SpdyWindowUpdateControlFrameBlock*>(frame_); |
| 791 } | 787 } |
| 792 | 788 |
| 793 DISALLOW_COPY_AND_ASSIGN(SpdyWindowUpdateControlFrame); | 789 DISALLOW_COPY_AND_ASSIGN(SpdyWindowUpdateControlFrame); |
| 794 }; | 790 }; |
| 795 | 791 |
| 796 } // namespace spdy | 792 } // namespace spdy |
| 797 | 793 |
| 798 #endif // NET_SPDY_SPDY_PROTOCOL_H_ | 794 #endif // NET_SPDY_SPDY_PROTOCOL_H_ |
| OLD | NEW |