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

Side by Side Diff: net/spdy/spdy_frame_builder.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/quic/quic_headers_stream_test.cc ('k') | net/spdy/spdy_frame_builder.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 #ifndef NET_SPDY_SPDY_FRAME_BUILDER_H_ 5 #ifndef NET_SPDY_SPDY_FRAME_BUILDER_H_
6 #define NET_SPDY_SPDY_FRAME_BUILDER_H_ 6 #define NET_SPDY_SPDY_FRAME_BUILDER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // capacity_. The given type must be a control frame type. 70 // capacity_. The given type must be a control frame type.
71 // Used only for SPDY versions >=4. 71 // Used only for SPDY versions >=4.
72 bool BeginNewFrame(const SpdyFramer& framer, 72 bool BeginNewFrame(const SpdyFramer& framer,
73 SpdyFrameType type, 73 SpdyFrameType type,
74 uint8_t flags, 74 uint8_t flags,
75 SpdyStreamId stream_id); 75 SpdyStreamId stream_id);
76 76
77 // Takes the buffer from the SpdyFrameBuilder. 77 // Takes the buffer from the SpdyFrameBuilder.
78 SpdySerializedFrame take() { 78 SpdySerializedFrame take() {
79 if (version_ == HTTP2) { 79 if (version_ == HTTP2) {
80 SPDY_BUG_IF(SpdyConstants::GetFrameMaximumSize(version_) < length_) 80 SPDY_BUG_IF(SpdyConstants::GetMaxFrameSizeLimit(version_) < length_)
81 << "Frame length " << length_ 81 << "Frame length " << length_
82 << " is longer than the maximum allowed length."; 82 << " is longer than the maximum possible allowed length.";
83 } 83 }
84 SpdySerializedFrame rv(buffer_.release(), length(), true); 84 SpdySerializedFrame rv(buffer_.release(), length(), true);
85 capacity_ = 0; 85 capacity_ = 0;
86 length_ = 0; 86 length_ = 0;
87 offset_ = 0; 87 offset_ = 0;
88 return rv; 88 return rv;
89 } 89 }
90 90
91 // Methods for adding to the payload. These values are appended to the end 91 // Methods for adding to the payload. These values are appended to the end
92 // of the SpdyFrameBuilder payload. Note - binary integers are converted from 92 // of the SpdyFrameBuilder payload. Note - binary integers are converted from
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 size_t capacity_; // Allocation size of payload, set by constructor. 143 size_t capacity_; // Allocation size of payload, set by constructor.
144 size_t length_; // Length of the latest frame in the buffer. 144 size_t length_; // Length of the latest frame in the buffer.
145 size_t offset_; // Position at which the latest frame begins. 145 size_t offset_; // Position at which the latest frame begins.
146 146
147 const SpdyMajorVersion version_; 147 const SpdyMajorVersion version_;
148 }; 148 };
149 149
150 } // namespace net 150 } // namespace net
151 151
152 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_ 152 #endif // NET_SPDY_SPDY_FRAME_BUILDER_H_
OLDNEW
« no previous file with comments | « net/quic/quic_headers_stream_test.cc ('k') | net/spdy/spdy_frame_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698