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

Unified Diff: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h

Issue 1878463002: Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tidy Created 4 years, 8 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: 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 5ba65b67b2cece7191965bcecde075ce18c58efa..56fe51540c04b9c224927973867d0ff59ef5b2fb 100644
--- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
+++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
@@ -90,6 +90,9 @@ public:
DECLARE_VIRTUAL_TRACE();
private:
+ class BlobLoader;
+ class Message;
+
enum MessageType {
MessageTypeText,
MessageTypeBlob,
@@ -99,32 +102,11 @@ private:
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);
void processSendQueue();
@@ -145,7 +127,7 @@ private:
void didStartClosingHandshake(WebSocketHandle*) override;
// Methods for BlobLoader.
- void didFinishLoadingBlob(PassRefPtr<DOMArrayBuffer>);
+ void didFinishLoadingBlob(DOMArrayBuffer*);
void didFailLoadingBlob(FileError::ErrorCode);
// m_handle is a handle of the connection.
@@ -159,7 +141,7 @@ private:
// m_identifier > 0 means calling scriptContextExecution() returns a Document.
unsigned long m_identifier;
Member<BlobLoader> m_blobLoader;
- Deque<OwnPtr<Message>> m_messages;
+ HeapDeque<Member<Message>> m_messages;
Vector<char> m_receivingMessageData;
bool m_receivingMessageTypeIsText;

Powered by Google App Engine
This is Rietveld 408576698