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

Unified Diff: Source/modules/websockets/WebSocket.h

Issue 311993006: [WebSocket] bufferedAmount should not decrease inside a task. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 months 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
Index: Source/modules/websockets/WebSocket.h
diff --git a/Source/modules/websockets/WebSocket.h b/Source/modules/websockets/WebSocket.h
index 8fd7bf97c1f20f319d370081cc0979ad4b20b3b0..cb022923a81088e0b63ab49a45e53390bccd4b02 100644
--- a/Source/modules/websockets/WebSocket.h
+++ b/Source/modules/websockets/WebSocket.h
@@ -120,7 +120,8 @@ public:
virtual void didReceiveMessage(const String& message) OVERRIDE;
virtual void didReceiveBinaryData(PassOwnPtr<Vector<char> >) OVERRIDE;
virtual void didReceiveMessageError() OVERRIDE;
- virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) OVERRIDE;
+ virtual void didIncreaseBufferedAmount(unsigned long) OVERRIDE;
+ virtual void didDecreaseBufferedAmount(unsigned long) OVERRIDE;
virtual void didStartClosingHandshake() OVERRIDE;
virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) OVERRIDE;
@@ -208,6 +209,7 @@ private:
// Updates m_bufferedAmountAfterClose given the amount of data passed to
// send() method after the state changed to CLOSING or CLOSED.
void updateBufferedAmountAfterClose(unsigned long);
+ void decreaseBufferedAmount(Timer<WebSocket>*);
void releaseChannel();
@@ -221,6 +223,7 @@ private:
State m_state;
KURL m_url;
unsigned long m_bufferedAmount;
+ unsigned long m_bufferedAmountDecrease;
unsigned long m_bufferedAmountAfterClose;
BinaryType m_binaryType;
// The subprotocol the server selected.
@@ -228,6 +231,7 @@ private:
String m_extensions;
RefPtrWillBeMember<EventQueue> m_eventQueue;
+ Timer<WebSocket> m_bufferedAmountDecreaseTimer;
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698