Commit 8a79453e authored by Bence Béky's avatar Bence Béky Committed by Commit Bot

Support fuzzing of SpdyHeadersIR and SpdyContinuationIR.

This CL lands server change 163977115 by diannahu.

BUG=488484

Change-Id: Iea6fd4a982db4cb3dbaf8e004a0e70e865f23550
Reviewed-on: https://chromium-review.googlesource.com/600247
Commit-Queue: Bence Béky <bnc@chromium.org>
Reviewed-by: default avatarHelen Li <xunjieli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491823}
parent 872164a1
......@@ -1407,8 +1407,7 @@ size_t SpdyFramer::GetNumberRequiredContinuationFrames(size_t size) {
return (overflow - 1) / payload_size + 1;
}
size_t SpdyFramer::GetHeaderFrameSizeSansBlock(
const SpdyHeadersIR& header_ir) const {
size_t SpdyFramer::GetHeaderFrameSizeSansBlock(const SpdyHeadersIR& header_ir) {
size_t min_size = kFrameHeaderSize;
if (header_ir.padded()) {
......@@ -1424,7 +1423,7 @@ size_t SpdyFramer::GetHeaderFrameSizeSansBlock(
}
size_t SpdyFramer::GetPushPromiseFrameSizeSansBlock(
const SpdyPushPromiseIR& push_promise_ir) const {
const SpdyPushPromiseIR& push_promise_ir) {
size_t size = kPushPromiseFrameMinimumSize;
if (push_promise_ir.padded()) {
......
......@@ -335,6 +335,15 @@ class SPDY_EXPORT_PRIVATE SpdyFramer {
// Gets the serialized flags for the given |frame|.
static uint8_t GetSerializedFlags(const SpdyFrameIR& frame);
// Calculates the number of bytes required to serialize a SpdyHeadersIR, not
// including the bytes to be used for the encoded header set.
static size_t GetHeaderFrameSizeSansBlock(const SpdyHeadersIR& header_ir);
// Calculates the number of bytes required to serialize a SpdyPushPromiseIR,
// not including the bytes to be used for the encoded header set.
static size_t GetPushPromiseFrameSizeSansBlock(
const SpdyPushPromiseIR& push_promise_ir);
explicit SpdyFramer(CompressionOption option);
virtual ~SpdyFramer();
......@@ -561,6 +570,9 @@ class SPDY_EXPORT_PRIVATE SpdyFramer {
void SetEncoderHeaderTableDebugVisitor(
std::unique_ptr<HpackHeaderTable::DebugVisitorInterface> visitor);
// Get (and lazily initialize) the HPACK encoder state.
HpackEncoder* GetHpackEncoder();
void SetOverwriteLastFrame(bool value) { overwrite_last_frame_ = value; }
void SetIsLastFrame(bool value) { is_last_frame_ = value; }
bool ShouldOverwriteLastFrame() const { return overwrite_last_frame_; }
......@@ -693,9 +705,6 @@ class SPDY_EXPORT_PRIVATE SpdyFramer {
};
private:
// Get (and lazily initialize) the HPACK encoder state.
HpackEncoder* GetHpackEncoder();
size_t GetNumberRequiredContinuationFrames(size_t size);
bool WritePayloadWithContinuation(SpdyFrameBuilder* builder,
......@@ -727,15 +736,6 @@ class SPDY_EXPORT_PRIVATE SpdyFramer {
const SpdyString& encoding,
ZeroCopyOutputBuffer* output) const;
// Calculates the number of bytes required to serialize a SpdyHeadersIR, not
// including the bytes to be used for the encoded header set.
size_t GetHeaderFrameSizeSansBlock(const SpdyHeadersIR& header_ir) const;
// Calculates the number of bytes required to serialize a SpdyPushPromiseIR,
// not including the bytes to be used for the encoded header set.
size_t GetPushPromiseFrameSizeSansBlock(
const SpdyPushPromiseIR& push_promise_ir) const;
// Serializes the flags octet for a given SpdyHeadersIR.
uint8_t SerializeHeaderFrameFlags(const SpdyHeadersIR& header_ir) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment