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

Unified Diff: net/spdy/spdy_frame_builder.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_frame_builder.h ('k') | net/spdy/spdy_framer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_frame_builder.cc
diff --git a/net/spdy/spdy_frame_builder.cc b/net/spdy/spdy_frame_builder.cc
index 91a48b12a95afc77976da7fbb4ea3b18366fe8b8..d4bbdedddc31ab1d6fd5544ecff4e9477982d072 100644
--- a/net/spdy/spdy_frame_builder.cc
+++ b/net/spdy/spdy_frame_builder.cc
@@ -109,7 +109,7 @@ bool SpdyFrameBuilder::BeginNewFrame(const SpdyFramer& framer,
if (length_ > 0) {
// Update length field for previous frame.
OverwriteLength(framer, length_ - framer.GetPrefixLength(type));
- SPDY_BUG_IF(SpdyConstants::GetFrameMaximumSize(version_) < length_)
+ SPDY_BUG_IF(framer.GetFrameMaximumSize() < length_)
<< "Frame length " << length_
<< " is longer than the maximum allowed length.";
}
@@ -170,11 +170,10 @@ bool SpdyFrameBuilder::RewriteLength(const SpdyFramer& framer) {
bool SpdyFrameBuilder::OverwriteLength(const SpdyFramer& framer,
size_t length) {
if (version_ == SPDY3) {
- DCHECK_LE(length,
- SpdyConstants::GetFrameMaximumSize(version_) -
- framer.GetFrameMinimumSize());
+ DCHECK_GE(framer.GetFrameMaximumSize() - framer.GetFrameMinimumSize(),
+ length);
} else {
- DCHECK_LE(length, SpdyConstants::GetFrameMaximumSize(version_));
+ DCHECK_GE(framer.GetFrameMaximumSize(), length);
}
bool success = false;
const size_t old_length = length_;
« no previous file with comments | « net/spdy/spdy_frame_builder.h ('k') | net/spdy/spdy_framer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698