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

Unified Diff: net/spdy/spdy_framer.cc

Issue 2566513004: This change removes SpdyFramer::set_enable_compression() in favor of a constructor parameter. (Closed)
Patch Set: 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_framer.h ('k') | net/spdy/spdy_framer_decoder_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index 501f4a459359d3b865118492980e8b9e689d5801..5d724f8452645205e0a9ff26a0606c5183dfaca5 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -153,13 +153,14 @@ bool SpdyFramerVisitorInterface::OnRstStreamFrameData(
return true;
}
-SpdyFramer::SpdyFramer(SpdyFramer::DecoderAdapterFactoryFn adapter_factory)
+SpdyFramer::SpdyFramer(SpdyFramer::DecoderAdapterFactoryFn adapter_factory,
+ CompressionOption option)
: current_frame_buffer_(kControlFrameBufferSize),
expect_continuation_(0),
visitor_(NULL),
debug_visitor_(NULL),
header_handler_(nullptr),
- enable_compression_(true),
+ compression_option_(option),
probable_http_response_(false),
end_stream_when_done_(false) {
// TODO(bnc): The way kMaxControlFrameSize is currently interpreted, it
@@ -174,7 +175,8 @@ SpdyFramer::SpdyFramer(SpdyFramer::DecoderAdapterFactoryFn adapter_factory)
}
}
-SpdyFramer::SpdyFramer() : SpdyFramer(&DecoderAdapterFactory) {}
+SpdyFramer::SpdyFramer(CompressionOption option)
+ : SpdyFramer(&DecoderAdapterFactory, option) {}
SpdyFramer::~SpdyFramer() {
}
@@ -1782,7 +1784,7 @@ SpdyFramer::SpdyHeaderFrameIterator::SpdyHeaderFrameIterator(
is_first_frame_(true),
has_next_frame_(true) {
encoder_ = framer_->GetHpackEncoder()->EncodeHeaderSet(
- headers_ir_->header_block(), framer_->enable_compression_);
+ headers_ir_->header_block(), framer_->compression_enabled());
}
SpdyFramer::SpdyHeaderFrameIterator::~SpdyHeaderFrameIterator() {}
@@ -2004,7 +2006,7 @@ SpdySerializedFrame SpdyFramer::SerializeHeaders(const SpdyHeadersIR& headers) {
}
string hpack_encoding;
- if (enable_compression_) {
+ if (compression_enabled()) {
GetHpackEncoder()->EncodeHeaderSet(headers.header_block(), &hpack_encoding);
} else {
GetHpackEncoder()->EncodeHeaderSetWithoutCompression(headers.header_block(),
@@ -2081,7 +2083,7 @@ SpdySerializedFrame SpdyFramer::SerializePushPromise(
}
string hpack_encoding;
- if (enable_compression_) {
+ if (compression_enabled()) {
GetHpackEncoder()->EncodeHeaderSet(push_promise.header_block(),
&hpack_encoding);
} else {
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_decoder_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698