Index: content/common/websocket_messages.h |
diff --git a/content/common/websocket_messages.h b/content/common/websocket_messages.h |
index 91d23e398696812a8f35571ef4198a57b1435c34..7cdfc28ac7272d892ce110b0c144afc24c361d90 100644 |
--- a/content/common/websocket_messages.h |
+++ b/content/common/websocket_messages.h |
@@ -46,6 +46,9 @@ |
IPC_ENUM_TRAITS_MAX_VALUE(content::WebSocketMessageType, |
content::WEB_SOCKET_MESSAGE_TYPE_LAST) |
+IPC_ENUM_TRAITS_MAX_VALUE(content::WebSocketBinaryType, |
+ content::WebSocketBinaryType::LAST) |
+ |
IPC_STRUCT_TRAITS_BEGIN(content::WebSocketHandshakeRequest) |
IPC_STRUCT_TRAITS_MEMBER(url) |
IPC_STRUCT_TRAITS_MEMBER(headers) |
@@ -90,6 +93,24 @@ IPC_MESSAGE_ROUTED2(WebSocketHostMsg_SendBlob, |
std::string /* uuid */, |
uint64_t /* expected_size */) |
+// Indicate that the type for receiving Binary messages has changed. The |
+// default type is WebSocketBinaryType::BLOB. In this mode the browser will |
+// build Blobs from received messages and transmit them to the renderer with a |
+// WebSocketMsg_BlobReceived IPC. The type can be changed to |
+// WebSocketBinaryType::ARRAY_BUFFER, in which case Binary messages will be sent |
+// to the renderer with WebSocketMsg_SendFrame IPCs in the same way as for Text |
+// messages. Changes to the type only take effect at the start of the next |
+// Binary message, so the render process has to be prepared to deal with a |
+// message of the "wrong" type. |
+IPC_MESSAGE_ROUTED1(WebSocketHostMsg_BinaryTypeChanged, |
+ content::WebSocketBinaryType /* new_type */); |
+ |
+// After taking a reference to a Blob received via a WebSocketMsg_BlobReceived |
+// IPC, the renderer should send this IPC to indicate that the browser no longer |
+// needs to hold a reference to the Blob. There is no need to indicate which |
+// Blob; they are confirmed in strict FIFO order. |
+IPC_MESSAGE_ROUTED0(WebSocketHostMsg_BlobConfirmed); |
+ |
// WebSocket messages sent from the browser to the renderer. |
// Respond to an AddChannelRequest. |selected_protocol| is the sub-protocol the |
@@ -133,6 +154,13 @@ IPC_MESSAGE_ROUTED1(WebSocketMsg_NotifyFailure, |
// send more messages. |
IPC_MESSAGE_ROUTED0(WebSocketMsg_BlobSendComplete); |
+// Indicates that a complete binary message has been received and stored in a |
+// Blob. The Blob does not count against the flow control quota supplied by the |
+// render process. |
+IPC_MESSAGE_ROUTED2(WebSocketMsg_BlobReceived, |
+ std::string /* uuid */, |
+ uint64_t /* size */); |
+ |
// WebSocket messages that can be sent in either direction. |
// Send a non-control frame to the channel. |