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

Unified Diff: net/spdy/spdy_frame_builder.h

Issue 2544813002: Remove enum SpdyMajorVersion. (Closed)
Patch Set: Merge comment changes from 140661724. Created 4 years 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_deframer_visitor_test.cc ('k') | net/spdy/spdy_frame_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_frame_builder.h
diff --git a/net/spdy/spdy_frame_builder.h b/net/spdy/spdy_frame_builder.h
index 159d8987c2bf253b190cd00398d57e96535948df..c445a9a2c2350de3d8bea44f562a32d6463a256f 100644
--- a/net/spdy/spdy_frame_builder.h
+++ b/net/spdy/spdy_frame_builder.h
@@ -31,7 +31,7 @@ class SpdyFramer;
class NET_EXPORT_PRIVATE SpdyFrameBuilder {
public:
// Initializes a SpdyFrameBuilder with a buffer of given size
- SpdyFrameBuilder(size_t size, SpdyMajorVersion version);
+ explicit SpdyFrameBuilder(size_t size);
~SpdyFrameBuilder();
@@ -51,10 +51,8 @@ class NET_EXPORT_PRIVATE SpdyFrameBuilder {
// GetWriteableBuffer() above.
bool Seek(size_t length);
- // Populates this frame with a HTTP2 frame prefix using version-specific
- // information from the |framer| and length information from |capacity_|. The
- // given type must be a control frame type.
- // Used only for HTTP2.
+ // Populates this frame with a HTTP2 frame prefix using length information
+ // from |capacity_|. The given type must be a control frame type.
bool BeginNewFrame(const SpdyFramer& framer,
SpdyFrameType type,
uint8_t flags,
@@ -62,11 +60,9 @@ class NET_EXPORT_PRIVATE SpdyFrameBuilder {
// Takes the buffer from the SpdyFrameBuilder.
SpdySerializedFrame take() {
- if (version_ == HTTP2) {
- SPDY_BUG_IF(SpdyConstants::GetMaxFrameSizeLimit(version_) < length_)
- << "Frame length " << length_
- << " is longer than the maximum possible allowed length.";
- }
+ SPDY_BUG_IF(SpdyConstants::kMaxFrameSizeLimit < length_)
+ << "Frame length " << length_
+ << " is longer than the maximum possible allowed length.";
SpdySerializedFrame rv(buffer_.release(), length(), true);
capacity_ = 0;
length_ = 0;
@@ -117,7 +113,6 @@ class NET_EXPORT_PRIVATE SpdyFrameBuilder {
// Update (in-place) the flags field in the frame being built to reflect the
// given flags value.
- // Used only for SPDY versions >=4.
bool OverwriteFlags(const SpdyFramer& framer, uint8_t flags);
private:
@@ -129,8 +124,6 @@ class NET_EXPORT_PRIVATE SpdyFrameBuilder {
size_t capacity_; // Allocation size of payload, set by constructor.
size_t length_; // Length of the latest frame in the buffer.
size_t offset_; // Position at which the latest frame begins.
-
- const SpdyMajorVersion version_;
};
} // namespace net
« no previous file with comments | « net/spdy/spdy_deframer_visitor_test.cc ('k') | net/spdy/spdy_frame_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698