Index: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h |
diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h |
index 56fe51540c04b9c224927973867d0ff59ef5b2fb..5ba65b67b2cece7191965bcecde075ce18c58efa 100644 |
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h |
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h |
@@ -90,9 +90,6 @@ |
DECLARE_VIRTUAL_TRACE(); |
private: |
- class BlobLoader; |
- class Message; |
- |
enum MessageType { |
MessageTypeText, |
MessageTypeBlob, |
@@ -102,10 +99,31 @@ |
MessageTypeClose, |
}; |
+ struct Message { |
+ explicit Message(const CString&); |
+ explicit Message(PassRefPtr<BlobDataHandle>); |
+ explicit Message(PassRefPtr<DOMArrayBuffer>); |
+ // For WorkerWebSocketChannel |
+ explicit Message(PassOwnPtr<Vector<char>>, MessageType); |
+ // Close message |
+ Message(unsigned short code, const String& reason); |
+ |
+ MessageType type; |
+ |
+ CString text; |
+ RefPtr<BlobDataHandle> blobDataHandle; |
+ RefPtr<DOMArrayBuffer> arrayBuffer; |
+ OwnPtr<Vector<char>> vectorData; |
+ unsigned short code; |
+ String reason; |
+ }; |
+ |
struct ReceivedMessage { |
bool isMessageText; |
Vector<char> data; |
}; |
+ |
+ class BlobLoader; |
DocumentWebSocketChannel(Document*, WebSocketChannelClient*, const String&, unsigned, WebSocketHandle*); |
void sendInternal(WebSocketHandle::MessageType, const char* data, size_t totalSize, uint64_t* consumedBufferedAmount); |
@@ -127,7 +145,7 @@ |
void didStartClosingHandshake(WebSocketHandle*) override; |
// Methods for BlobLoader. |
- void didFinishLoadingBlob(DOMArrayBuffer*); |
+ void didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer>); |
void didFailLoadingBlob(FileError::ErrorCode); |
// m_handle is a handle of the connection. |
@@ -141,7 +159,7 @@ |
// m_identifier > 0 means calling scriptContextExecution() returns a Document. |
unsigned long m_identifier; |
Member<BlobLoader> m_blobLoader; |
- HeapDeque<Member<Message>> m_messages; |
+ Deque<OwnPtr<Message>> m_messages; |
Vector<char> m_receivingMessageData; |
bool m_receivingMessageTypeIsText; |