summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/spdy/spdy_framer.cc18
-rw-r--r--net/spdy/spdy_framer.h19
2 files changed, 19 insertions, 18 deletions
diff --git a/net/spdy/spdy_framer.cc b/net/spdy/spdy_framer.cc
index a6423e1..d29a750 100644
--- a/net/spdy/spdy_framer.cc
+++ b/net/spdy/spdy_framer.cc
@@ -1965,19 +1965,17 @@ bool SpdyFramer::IncrementallyDeliverControlFrameHeaderData(
void SpdyFramer::SerializeNameValueBlockWithoutCompression(
SpdyFrameBuilder* builder,
- const SpdyFrameWithNameValueBlockIR& frame) const {
- const SpdyNameValueBlock* name_value_block = &(frame.name_value_block());
-
+ const SpdyNameValueBlock& name_value_block) const {
// Serialize number of headers.
if (protocol_version() < 3) {
- builder->WriteUInt16(name_value_block->size());
+ builder->WriteUInt16(name_value_block.size());
} else {
- builder->WriteUInt32(name_value_block->size());
+ builder->WriteUInt32(name_value_block.size());
}
// Serialize each header.
- for (SpdyHeaderBlock::const_iterator it = name_value_block->begin();
- it != name_value_block->end();
+ for (SpdyHeaderBlock::const_iterator it = name_value_block.begin();
+ it != name_value_block.end();
++it) {
if (protocol_version() < 3) {
builder->WriteString(it->first);
@@ -1993,14 +1991,16 @@ void SpdyFramer::SerializeNameValueBlock(
SpdyFrameBuilder* builder,
const SpdyFrameWithNameValueBlockIR& frame) {
if (!enable_compression_) {
- return SerializeNameValueBlockWithoutCompression(builder, frame);
+ return SerializeNameValueBlockWithoutCompression(builder,
+ frame.name_value_block());
}
// First build an uncompressed version to be fed into the compressor.
const size_t uncompressed_len = GetSerializedLength(
protocol_version(), &(frame.name_value_block()));
SpdyFrameBuilder uncompressed_builder(uncompressed_len);
- SerializeNameValueBlockWithoutCompression(&uncompressed_builder, frame);
+ SerializeNameValueBlockWithoutCompression(&uncompressed_builder,
+ frame.name_value_block());
scoped_ptr<SpdyFrame> uncompressed_payload(uncompressed_builder.take());
z_stream* compressor = GetHeaderCompressor();
diff --git a/net/spdy/spdy_framer.h b/net/spdy/spdy_framer.h
index 266dabf..cebc320 100644
--- a/net/spdy/spdy_framer.h
+++ b/net/spdy/spdy_framer.h
@@ -504,6 +504,14 @@ class NET_EXPORT_PRIVATE SpdyFramer {
SpdyPriority GetLowestPriority() const { return spdy_version_ < 3 ? 3 : 7; }
SpdyPriority GetHighestPriority() const { return 0; }
+ // Deliver the given control frame's compressed headers block to the visitor
+ // in decompressed form, in chunks. Returns true if the visitor has
+ // accepted all of the chunks.
+ bool IncrementallyDecompressControlFrameHeaderData(
+ SpdyStreamId stream_id,
+ const char* data,
+ size_t len);
+
protected:
FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest, BasicCompression);
FRIEND_TEST_ALL_PREFIXES(SpdyFramerTest, ControlFrameSizesAreValidated);
@@ -556,14 +564,7 @@ class NET_EXPORT_PRIVATE SpdyFramer {
z_stream* GetHeaderCompressor();
z_stream* GetHeaderDecompressor();
- // Deliver the given control frame's compressed headers block to the visitor
- // in decompressed form, in chunks. Returns true if the visitor has
- // accepted all of the chunks.
- bool IncrementallyDecompressControlFrameHeaderData(
- SpdyStreamId stream_id,
- const char* data,
- size_t len);
-
+ private:
// Deliver the given control frame's uncompressed headers block to the
// visitor in chunks. Returns true if the visitor has accepted all of the
// chunks.
@@ -585,7 +586,7 @@ class NET_EXPORT_PRIVATE SpdyFramer {
void SerializeNameValueBlockWithoutCompression(
SpdyFrameBuilder* builder,
- const SpdyFrameWithNameValueBlockIR& frame) const;
+ const SpdyNameValueBlock& name_value_block) const;
// Compresses automatically according to enable_compression_.
void SerializeNameValueBlock(