summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_session.h
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-17 19:23:49 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-17 19:23:49 +0000
commit09a8d917eb7bc6b45277b24a851ccec6e8e499a9 (patch)
treeabeb2c359417e5681f241c0d8eba10ceacc69aa1 /net/spdy/spdy_session.h
parent15c709e5127e3fd3c27b4bd2ac7d642608582f23 (diff)
downloadchromium_src-09a8d917eb7bc6b45277b24a851ccec6e8e499a9.zip
chromium_src-09a8d917eb7bc6b45277b24a851ccec6e8e499a9.tar.gz
chromium_src-09a8d917eb7bc6b45277b24a851ccec6e8e499a9.tar.bz2
[SPDY] Avoid leaking bytes from the session flow control receive window
Add a way to add ConsumeCallbacks to a SpdyBuffer in order to be notified when Consume() is called. Use that to ensure that flow control receive windows are updated appropriately regardless of what the SpdyStream's delegate does. Make IncreaseRevWindowSize private in both SpdyStream and SpdySession. BUG=176592 Review URL: https://codereview.chromium.org/14311002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194655 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.h')
-rw-r--r--net/spdy/spdy_session.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h
index 55ac9f9..0746398 100644
--- a/net/spdy/spdy_session.h
+++ b/net/spdy/spdy_session.h
@@ -316,13 +316,6 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>,
void SendStreamWindowUpdate(SpdyStreamId stream_id,
uint32 delta_window_size);
- // Called by a stream to increase this session's receive window size
- // by |delta_window_size|, which must be at least 1 and must not
- // cause this session's receive window size to overflow, possibly
- // also sending a WINDOW_UPDATE frame. Does nothing if session flow
- // control is turned off.
- void IncreaseRecvWindowSize(int32 delta_window_size);
-
// If session is closed, no new streams/transactions should be created.
bool IsClosed() const { return state_ == STATE_CLOSED; }
@@ -470,6 +463,8 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>,
FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, AdjustSendWindowSize31);
FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test,
SessionFlowControlInactiveStream31);
+ FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test,
+ SessionFlowControlNoReceiveLeaks31);
FRIEND_TEST_ALL_PREFIXES(SpdySessionSpdy3Test, SessionFlowControlEndToEnd31);
typedef std::deque<SpdyStreamRequest*> PendingStreamRequestQueue;
@@ -684,6 +679,15 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>,
// cause this session's send window size to go negative.
void DecreaseSendWindowSize(int32 delta_window_size);
+ // Called by SpdyBuffers (via ConsumeCallbacks) to increase this
+ // session's receive window size by |delta_window_size|, which must
+ // be at least 1 and must not cause this session's receive window
+ // size to overflow, possibly also sending a WINDOW_UPDATE
+ // frame. Also called during initialization to set the initial
+ // receive window size. Does nothing if session flow control is
+ // turned off.
+ void IncreaseRecvWindowSize(size_t delta_window_size);
+
// If session flow control is turned on, called by OnStreamFrameData
// (which is in turn called by the framer) to decrease this
// session's receive window size by |delta_window_size|, which must