Index: content/common/websocket_messages.h |
diff --git a/content/common/websocket_messages.h b/content/common/websocket_messages.h |
index e0af254960e62e89adb95258b5f209435c7bad31..7e6d8eb69cf32bf7292048a3740ae3b57682c549 100644 |
--- a/content/common/websocket_messages.h |
+++ b/content/common/websocket_messages.h |
@@ -73,6 +73,23 @@ IPC_MESSAGE_ROUTED4(WebSocketHostMsg_AddChannelRequest, |
url::Origin /* origin */, |
int /* render_frame_id */) |
+// Send a complete binary WebSocket message consisting of the Blob identified by |
+// |uuid|. The message will be split into frames as necessary. |expected_size| |
+// must match the browser's idea of the size of the Blob to prevent flow control |
+// from becoming desynchronised. If it does not match the connection will be |
+// terminated with a WebSocketMsg_NotifyFailure message. On success, the browser |
+// will have consumed |expected_size| bytes of flow control send quota and the |
+// renderer needs to subtract that from its running total of flow control send |
+// quota. See the design doc at |
+// https://docs.google.com/document/d/1CDiXB9pBumhFVVfmIn1CRI6v6byxyqWu2urEE9xp714/edit |
+// SendFrame or SendBlob IPCs must not be sent by the renderer until the |
+// BlobSendComplete message has been received from the browser. The renderer |
+// should retain a reference to the Blob until either a BlobSendComplete or |
+// NotifyFailure IPC is received. |
+IPC_MESSAGE_ROUTED2(WebSocketHostMsg_SendBlob, |
+ std::string /* uuid */, |
+ uint64_t /* expected_size */) |
+ |
// WebSocket messages sent from the browser to the renderer. |
// Respond to an AddChannelRequest. |selected_protocol| is the sub-protocol the |
@@ -111,6 +128,11 @@ IPC_MESSAGE_ROUTED1(WebSocketMsg_NotifyFinishOpeningHandshake, |
IPC_MESSAGE_ROUTED1(WebSocketMsg_NotifyFailure, |
std::string /* message */) |
+// Indicates tbat the current Blob has finished sending. The renderer can |
+// release its reference on the Blob, and may now use SendFrame or SendBlob to |
+// send more messages. |
+IPC_MESSAGE_ROUTED0(WebSocketMsg_BlobSendComplete); |
+ |
// WebSocket messages that can be sent in either direction. |
// Send a non-control frame to the channel. |