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

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

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 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;

Powered by Google App Engine
This is Rietveld 408576698