Index: Source/modules/websockets/MainThreadWebSocketChannel.h |
diff --git a/Source/modules/websockets/MainThreadWebSocketChannel.h b/Source/modules/websockets/MainThreadWebSocketChannel.h |
index 41348ffc1e78b594d14c35a20df32d6e688f74f1..3e2d7aca672ac642e81fab16820e024c2121a6ac 100644 |
--- a/Source/modules/websockets/MainThreadWebSocketChannel.h |
+++ b/Source/modules/websockets/MainThreadWebSocketChannel.h |
@@ -77,7 +77,6 @@ public: |
virtual WebSocketChannel::SendResult send(const ArrayBuffer&, unsigned byteOffset, unsigned byteLength) OVERRIDE; |
virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRIDE; |
virtual WebSocketChannel::SendResult send(PassOwnPtr<Vector<char> > data) OVERRIDE; |
- virtual unsigned long bufferedAmount() const OVERRIDE; |
// Start closing handshake. Use the CloseEventCodeNotSpecified for the code |
// argument to omit payload. |
virtual void close(int code, const String& reason) OVERRIDE; |
@@ -91,7 +90,7 @@ public: |
virtual void didOpenSocketStream(SocketStreamHandle*) OVERRIDE; |
virtual void didCloseSocketStream(SocketStreamHandle*) OVERRIDE; |
virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char*, int) OVERRIDE; |
- virtual void didUpdateBufferedAmount(SocketStreamHandle*, size_t bufferedAmount) OVERRIDE; |
+ virtual void didConsumeBufferedAmount(SocketStreamHandle*, size_t consumed) OVERRIDE; |
virtual void didFailSocketStream(SocketStreamHandle*, const SocketStreamError&) OVERRIDE; |
// FileReaderLoaderClient functions. |
@@ -103,6 +102,25 @@ public: |
private: |
MainThreadWebSocketChannel(Document*, WebSocketChannelClient*, const String&, unsigned); |
+ class FramingOverhead { |
+ public: |
+ FramingOverhead(WebSocketFrame::OpCode opcode, size_t frameDataSize, size_t originalPayloadLength) |
+ : m_opcode(opcode) |
+ , m_frameDataSize(frameDataSize) |
+ , m_originalPayloadLength(originalPayloadLength) |
+ { |
tyoshino (SeeGerritForStatus)
2014/06/16 02:29:28
indent
yhirano
2014/06/16 04:44:27
Done.
|
+ } |
+ |
+ WebSocketFrame::OpCode opcode() const { return m_opcode; } |
+ size_t frameDataSize() const { return m_frameDataSize; } |
+ size_t originalPayloadLength() const { return m_originalPayloadLength; } |
+ |
+ private: |
+ WebSocketFrame::OpCode m_opcode; |
+ size_t m_frameDataSize; |
+ size_t m_originalPayloadLength; |
+ }; |
+ |
void clearDocument(); |
void disconnectHandle(); |
@@ -198,7 +216,6 @@ private: |
Timer<MainThreadWebSocketChannel> m_closingTimer; |
ChannelState m_state; |
bool m_shouldDiscardReceivedData; |
- unsigned long m_unhandledBufferedAmount; |
unsigned long m_identifier; // m_identifier == 0 means that we could not obtain a valid identifier. |
@@ -211,6 +228,8 @@ private: |
Deque<OwnPtr<QueuedFrame> > m_outgoingFrameQueue; |
OutgoingFrameQueueStatus m_outgoingFrameQueueStatus; |
+ Deque<FramingOverhead> m_framingOverheadQueue; |
+ size_t m_numConsumedBytesInCurrentFrame; |
// FIXME: Load two or more Blobs simultaneously for better performance. |
OwnPtr<FileReaderLoader> m_blobLoader; |