Added a flow control blocked notification message.

This message indicates to the recipient that the sender believes that it
is flow-control blocked but otherwise ready to send data. The BLOCKED frame
is purely advisory and optional.

This lands server change 56838900 by ygi.

R=rch@chromium.org

Review URL: https://codereview.chromium.org/139573002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245274 0039d316-1c4b-4281-b951-d872f2087c98
parent dadf8c49
...@@ -1882,6 +1882,11 @@ SpdySerializedFrame* SpdyFramer::SerializeSettings( ...@@ -1882,6 +1882,11 @@ SpdySerializedFrame* SpdyFramer::SerializeSettings(
return builder.take(); return builder.take();
} }
SpdyFrame* SpdyFramer::CreateBlocked(SpdyStreamId stream_id) {
SpdyBlockedIR blocked_ir(stream_id);
return SerializeBlocked(blocked_ir);
}
SpdyFrame* SpdyFramer::SerializeBlocked(const SpdyBlockedIR& blocked) const { SpdyFrame* SpdyFramer::SerializeBlocked(const SpdyBlockedIR& blocked) const {
DCHECK_LE(4, protocol_version()); DCHECK_LE(4, protocol_version());
SpdyFrameBuilder builder(GetBlockedSize()); SpdyFrameBuilder builder(GetBlockedSize());
......
...@@ -440,10 +440,11 @@ class NET_EXPORT_PRIVATE SpdyFramer { ...@@ -440,10 +440,11 @@ class NET_EXPORT_PRIVATE SpdyFramer {
SpdySerializedFrame* SerializeCredential( SpdySerializedFrame* SerializeCredential(
const SpdyCredentialIR& credential) const; const SpdyCredentialIR& credential) const;
// Serializes a BLOCKED frame. The BLOCKED frame is used to indicate to the // Creates and serializes a BLOCKED frame. The BLOCKED frame is used to
// remote endpoint that this endpoint believes itself to be flow-control // indicate to the remote endpoint that this endpoint believes itself to be
// blocked but otherwise ready to send data. The BLOCKED frame is purely // flow-control blocked but otherwise ready to send data. The BLOCKED frame
// advisory and optional. // is purely advisory and optional.
SpdyFrame* CreateBlocked(SpdyStreamId stream_id);
SpdySerializedFrame* SerializeBlocked(const SpdyBlockedIR& blocked) const; SpdySerializedFrame* SerializeBlocked(const SpdyBlockedIR& blocked) const;
// Creates and serializes a PUSH_PROMISE frame. The PUSH_PROMISE frame is used // Creates and serializes a PUSH_PROMISE frame. The PUSH_PROMISE frame is used
......
...@@ -3031,7 +3031,25 @@ TEST_P(SpdyFramerTest, SerializeBlocked) { ...@@ -3031,7 +3031,25 @@ TEST_P(SpdyFramerTest, SerializeBlocked) {
SpdyBlockedIR blocked_ir(0); SpdyBlockedIR blocked_ir(0);
scoped_ptr<SpdySerializedFrame> frame(framer.SerializeFrame(blocked_ir)); scoped_ptr<SpdySerializedFrame> frame(framer.SerializeFrame(blocked_ir));
CompareFrame(kDescription, *frame, kFrameData, arraysize(kFrameData)); CompareFrame(kDescription, *frame, kFrameData, arraysize(kFrameData));
}
TEST_P(SpdyFramerTest, CreateBlocked) {
if (spdy_version_ < SPDY4) {
return;
}
SpdyFramer framer(spdy_version_);
const char kDescription[] = "BLOCKED frame";
const SpdyStreamId kStreamId = 3;
scoped_ptr<SpdySerializedFrame> frame_serialized(
framer.CreateBlocked(kStreamId));
SpdyBlockedIR blocked_ir(kStreamId);
scoped_ptr<SpdySerializedFrame> frame_created(
framer.SerializeFrame(blocked_ir));
CompareFrames(kDescription, *frame_serialized, *frame_created);
} }
TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) { TEST_P(SpdyFramerTest, CreatePushPromiseUncompressed) {
......
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